Tutorials for common R workflows, presented at R Office Hours
Each notebook focuses on a different topic. The goal of the notebooks is to show examples of the topic on public health-style data. The notebooks try to show a variety of ways to do things and the various options available - the options are meant to be examples, but are not always best practices. All data needed to run these notebooks can be found in the data folder in this repo. The data is all publicly available, or is synthetic data that has been created to mimic real world public-health data. For each notebook there is a .qmd file, which is a Quarto document which can be used to run the code yourself, and there is a .md file, which is a markdown document which allows you to see the code and visualizations in their rendered form in this repo.
The notebooks (found in the notebooks folder) are:
- exploratory_data_analysis: this notebook shows an example of how to start exploring a data set, including cleaning the data, grouping and combining data, calculating summary statistics, and visualizing the data
- survey_analysis: this notebook gives examples of how to analyze survey data, using the R {survey} package
- Modern R Development Guide: documentation of current best practices for R development, emphasizing modern tidyverse patterns, performance, and style
- The Epidemiologist R Handbook: R reference manual, includes common epidemiological examples
- R 4 Epidemiology: R textbook, with public health examples
- Population Health Data Science with R: R textbook aimed at public health epidemiologists and health care analysts
- Statistical Inference via Data Science: A ModernDive into R and the Tidyverse: examples of getting started in R, data visualization, wrangling, statistics
- R for Data Science: R textbook for data science workflows and learning tidyverse conventions
- Advanced R: R textbook for more advanced R concepts
- The R Graph Gallery: a collection of many different types of charts made with R, with a focus on using tidyverse and ggplot2, good for inspiration and showing the different possibilities of creating visualizations with R. Also shows the various theme options when using ggplot2.
- Modern Data Visualization with R: A textbook that walks through all the aspects of creating visualizations with ggplot2, and shows other options for visualizations
- Accessible color palette generator: creates many different options for an accessible color palette. The {viridis} package in R is also useful for accessible color palettes.
- Saloni's guide to data visualization: an interesting blog post about data visualization, why it is important, and how to make it better. Our World in Data has a lot of good examples of clear data visualizations.
- Create your own custom ggplot2 theme: a guide for creating a custom theme for ggplot2 plots, can be useful for establishing a consistent style guide for your team. There is also an explainer for the BBC's custom ggplot2 theme