Working with ggplots in R

ggplot or grammar of graphics plots, is built for making profressional looking, plots quickly with minimal code.

General

[https://www.rstudio.com/wp-content/uploads/2015/03/ggplot2-cheatsheet.pdf]

  • Cheatsheet - basic layers

[http://ggplot2.tidyverse.org/reference/]

  • ggplot basics and function reference

  • geom layers

  • stat layers

  • position adjustment layers

  • annotations layers

  • aesthetics layers

  • scale layers

  • axes and legends

  • facetting and facetting layers

  • coordinate systems

  • themes

  • programming with ggplot2

  • vector helpers

  • built in datasets

  • autoplot and fortify

Colors

[http://sape.inf.usi.ch/quick-reference/ggplot2/colour]

  • quick reference for colors in ggplot2

  • predefined colour names

[http://www.cookbook-r.com/Graphs/]

  • various graphs you can make with ggplot2 with options for customization

  • bar, line, distributions, scatterplots

  • titles, axes, legends, lines, facets, multiple graphs on one page, colors

Legends

[http://zevross.com/blog/2014/08/04/beautiful-plotting-in-r-a-ggplot2-cheatsheet-3/#manually-adding-legend-items-guides-override.aes]

  • cheatsheet for customizing graphics and legends for ggplot2

[https://github.com/tidyverse/ggplot2/wiki/Legend-Attributes]

  • legend basics for ggplot2

[http://www.cookbook-r.com/Graphs/Legends_(ggplot2)/#changing-the-order-of-items-in-the-legend]

  • legend customization in ggplot2

Themes

[http://ggplot2.tidyverse.org/reference/theme.html]

  • modifying components of a theme in ggplot2

[https://stackoverflow.com/questions/2359723/how-to-add-a-title-to-a-ggplot-when-the-title-is-a-variable-name]

  • Using a variable value in a title for ggplot2

Multivariate Analysis

[https://learnr.files.wordpress.com/2009/08/latbook.pdf]

  • using lattice for multivariate data visualization with ggplot2

[http://ggplot2.tidyverse.org/reference/geom_density.html]

  • arguments and aesthetics for geomdensity() and statdensity()

[http://t-redactyl.io/blog/2016/02/creating-plots-in-r-using-ggplot2-part-7-histograms.html]

  • histograms in ggplot2 with customization options

[http://www.cookbook-r.com/Graphs/Plotting_means_and_error_bars_(ggplot2)/]

  • plotting means and error bars in ggplot2

[http://ggplot2.tidyverse.org/reference/geom_boxplot.html]

  • arguments and aesthetics for box and whisker plots in ggplot2

[https://plot.ly/ggplot2/box-plots/]

  • boxplot customization in ggplot2

  • Uses function geomboxplot()

[https://stackoverflow.com/questions/14604439/plot-multiple-boxplot-in-one-graph]

  • plotting multiple boxplots in one graph

[https://rpubs.com/danmirman/plotting_factor_analysis]

  • plotting factor analysis results in ggplot2

[http://rstudio-pubs-static.s3.amazonaws.com/3365_9573f6d661b444499365fe1841ee65d3.html]

  • plotting functions in ggplot2

[https://stackoverflow.com/questions/31079210/how-can-i-add-annotations-below-the-x-axis-in-ggplot2]

  • adding annotations below a graph in ggplot2

[http://www.cookbook-r.com/Graphs/Plotting_distributions_(ggplot2)/]

  • plotting distributions using histograms, density plots, and box plots in ggplot2

[http://t-redactyl.io/blog/2016/03/creating-plots-in-r-using-ggplot2-part-9-function-plots.html]

  • function plots in ggplot2

[http://www.sthda.com/english/wiki/ggplot2-colors-how-to-change-colors-automatically-and-manually]

  • changing plot colors automatically and manually in ggplot2

[https://cran.r-project.org/web/packages/ggfortify/vignettes/plot_pca.html]

  • plotting PCA in ggplot2

[http://www.sthda.com/english/wiki/ggfortify-extension-to-ggplot2-to-handle-some-popular-packages-r-software-and-data-visualization#diagnostic-plots-with-generalized-linear-models-glm]

  • diagnostic plots for GLMS.

  • Uses function autoplot() and library ggfortify

[https://stackoverflow.com/questions/31185522/q-ggbiplot-foreground-arrows-change-arrow-color]

  • adjusting layer order in ggplot2

[https://stackoverflow.com/questions/25995173/specifying-colour-transparency-and-position-of-arrows-line-segments-in-ggbipl]

  • changing color, transparency, and position of arrows in PCA using function ggbiplot()