Data Science with R
Eight data-wrangling parts, then EDA: testing, regression, PCA
A hands-on class on doing data science in R: eight data-wrangling parts (Introduction → Manipulate Data Types) and an exploratory data analysis extension covering hypothesis testing, linear modeling and principal component analysis. The data-wrangling slides are Keynote decks exported to PDF; the EDA slides are interactive Quarto revealjs decks. Every part pairs its slides with a Quarto exercise file you can open and work through.
This material builds on the work of Garrett Grolemund from posit, reusing part of his tidyverse-related workshop material from https://github.com/rstudio-education/remaster-the-tidyverse under the Creative Commons BY-SA 4.0 license.
Data wrangling with R
Slides (PDF) and exercises (Quarto) for each of the eight parts. Open an exercise file to work through it; download any supplementary material listed.
| Part | Title | Slides | Exercises | Suppl. Material |
|---|---|---|---|---|
| 1 | Introduction | Quarto | ||
| 2 | Visualize Data | Quarto | ||
| 3 | Transform Data | Quarto | CSV | |
| 4 | Model Data | Quarto | ZIP | |
| 5 | Communicate Data | Quarto | Quarto | |
| 6 | Tidy Data | Quarto | ||
| 7 | Join Data | Quarto | ||
| 8 | Manipulate Data Types | Quarto |
Exploratory data analysis with R
Three parts, each with an interactive slide deck and a matching exercise file.
| Part | Title | Slides | Exercises | Suppl. Material |
|---|---|---|---|---|
| 1 | Hypothesis Testing | Quarto | Quarto | |
| 2 | Linear Regression | Quarto | Quarto | ZIP |
| 3 | Principal Component Analysis | Quarto | Quarto | ZIP |
Prerequisites
- R: https://www.r-project.org
- RStudio or Positron: https://posit.co/download/rstudio-desktop/ / https://positron.posit.co/download.html
- Quarto: https://quarto.org/docs/get-started/
- Tidyverse: https://www.tidyverse.org
R packages
- Data sets:
{babynames}(baby-name frequency, US 1880–2017),{nycflights13}(2013 NYC flight records). - Data wrangling:
{janitor},{skimr}. - Extra visualization:
{ggcorrplot},{ggfortify},{plotly}. - Reporting:
{DT}(DataTables),{gt},{kableExtra}. - Model summaries:
{broom}. - PCA:
{FactoMineR},{factoextra},{corrplot},{viridis},{huxtable},{umap}.