Prerequisites and Preparations

  • You should have some basic knowledge of R, and be familiar with the topics covered in the Introduction to R.
  • Have a recent version of R and RStudio installed.
  • Install and load the tidyverse package.
install.packages("tidyverse")  
library(tidyverse)
  • Create a new RStudio project R-data-ws in a new folder R-data-ws. Download both CSV files into a subdirectory called data like this:
  • Download MS_trafficstops_bw_age.csv:
download.file("http://bit.ly/MS_trafficstops_bw_age",
              "data/MS_trafficstops_bw_age.csv")
  • Download MS_acs2015_bw.csv:
download.file("http://bit.ly/MS_acs_2015_bw",
              "data/MS_acs2015_bw.csv")

References

Boehmke, Bradley C. (2016) Data Wrangling with R http://link.springer.com/book/10.1007%2F978-3-319-45599-0

Grolemund, G & Wickham, H (2023): R for Data Science https://r4ds.hadley.nz

Wickham, H. (2014): Tidy Data https://www.jstatsoft.org/article/view/v059i10

Acknowledgements

Part of the materials for this tutorial are adapted from http://datacarpentry.org and http://softwarecarpentry.org.