Plotting in R
October 13, 2019 — March 5, 2022
Plotting for R is a major selling point of the platform. And thanks to projects like shiny, it is not only for your own computer but can even be used to backend webapps.
1 native
Basic R plotting via the plot
command is functional.
2 ggplot2
More tidyverse! Probably the favourite plotting system for R these days.
Kieran Healy advises the following setup for visualisation in the tidyverse style:
my_packages <- c("tidyverse", "broom", "coefplot", "cowplot",
"gapminder", "GGally", "ggrepel", "ggridges", "gridExtra",
"interplot", "margins", "maps", "mapproj", "mapdata",
"MASS", "quantreg", "scales", "survey", "srvyr",
"viridis", "viridisLite", "devtools")
install.packages(my_packages,
repos = "http://cran.rstudio.com")
yonicd/ggedit: Interactively edit ggplot layer aesthetics and theme definitions.
ggedit is a package that helps users bridge the gap between making a plot and getting all of those pesky plot aesthetics just right, all while keeping everything portable for further research and collaboration.
ggedit is powered by a Shiny gadget where the user inputs a ggplot plot object or a list of ggplot objects. You can run ggedit directly from the console or from the Addin menu within RStudio.
The ggplot2 reference is thorough but inscrutable without knowing the philosophy of the thing.
Fancy features are best discovered via the extension gallery.
The cheat sheet has graphical references, which is the appropriate way to consider this thing.
Max Woolf’s simple ggplot tutorial
The ggplot chapter of R for data science.
Want arbitrary lines and stuff to appear in the legends? E.g. a mean line or multiple model fits.
diagrammer emits your graphs as JavaScript widgets. V Web2.0 wow.
ggvis is a planned next iteration of the Hadley Wickham’s ggplot family, AFAICT, but currently on hiatus
animating is sort of possible using ggplot2 but it is not fun.
gggedit is an interactive RStudio extension for dynamically adjusting plots
[Plotly graphing library for ggplot2 in ggplot2](https: