R Basics Chapters

New to R? Start here. This section covers the fundamentals: installing and navigating R and RStudio, working with variables and functions, and using the tidyverse to import, wrangle, and visualize data. Along the way you will meet correlation and regression, your first ggplot, hypothesis tests and p-values, and how to handle missing values and outliers. No prior R experience is assumed.

The chapters in this section use the R packages below. Run this once to install any that are missing:

pkgs <- c(
  "tidyverse", "here", "readxl", "openxlsx", "haven",
  "data.table", "vroom", "janitor", "naniar", "broom"
)
install.packages(setdiff(pkgs, rownames(installed.packages())))

How to navigate ..

.. through chapters

You can navigate chapters by clicking on the table of chapters on the left. Alternatively, you can always go to the next chapter by clicking on its name at the end (i.e. scroll all the way down)

.. through content within chapters

Within a chapter, you can navigate through the content by clicking on the table of contents on the right.