This workshop covers how to use ggplot2
for making plots in R.
Slides are available at https://nuitrcs.github.io/r-ggplot2-april2020/slides/, or open the index.html
file in the slides folder of the workshop materials once you download them.
You will need R and RStudio for this workshop, and you will need the files from this repository to do the exercises. See installing or accessing R and RStudio for instructions.
Whether using R on your laptop or in the cloud, there are several packages you'll need to install:
- tidyverse (ggplot2 is included here, and a few additional packages are used for data manipulation prior to plotting)
- babynames
Install these with the R command
install.packages(c("tidyverse", "babynames"),
repos="http://cran.rstudio.com")
or use the buttons in the Packages window in RStudio to install them.
If you previously installed tidyverse
or ggplot2
, please update ggplot2
to the current version (3.3). You can use the Update button the Packages tab in RStudio to update the package.
ggplot2
Cheat Sheet: you'll want to have this for reference
See our online learning resources guide for ggplot2 on the Research Computing Services blog for suggestions of resources to practice your skills and learn more.