Resources
Where to go next, and where to get help
Getting help
- In R: type
?function_namein the Console (for example?mutate) to open its help page. - Setup problems: see Troubleshooting for installing Rtools (Windows) and the Xcode Command Line Tools and gfortran (Mac).
- During the workshop: put up your red sticky note!
Free books and guides
- R for Data Science (2e) — the standard introduction to the tidyverse, by the people who wrote it. Free online.
- The Epidemiologist R Handbook — hundreds of applied examples for public health, using the same packages as this workshop. The workshop’s outbreak dataset is based on its example linelist.
- Data Carpentry: R for Social Scientists and R for Ecologists — other beginner R lessons in the same hands-on style.
Base R and the tidyverse
- Base R ↔︎ tidyverse — this workshop’s translation table: every tidyverse function we use, its base R equivalent, and what to watch out for.
- Advanced R: Subsetting and Vectors — when you want to understand vectors, lists, and
[[ ]]in depth.
Cheat sheets
Posit’s one-page cheat sheets are great to keep open while you work: all cheat sheets. The most useful for this workshop:
- Data transformation with dplyr — Sessions 1–5
- Data tidying with tidyr — Session 4
- Data visualization with ggplot2 — Sessions 6–7
- Factors with forcats, Strings with stringr, Dates and times with lubridate
- Apply functions with purrr — Session 8
- Base R — vectors, lists, indexing, and the apply family (in the “Contributed” section of the cheat sheet page)
Packages used in the workshop
| Package | What we use it for |
|---|---|
| tidyverse | dplyr (wrangling), ggplot2 (plots), tidyr (reshaping), stringr, forcats, lubridate, purrr |
| here | file paths that work on any computer |
| rio | import() and export() for almost any file type |
| janitor | clean_names(), tabyl(), get_dupes() |
| skimr | skim() summaries |
| gtsummary | publication-ready tables |
| scales | formatting percentages |