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("https://github.com/cengel/R-data-wrangling/raw/master/data/MS_trafficstops_bw_age.csv",
              "data/MS_trafficstops_bw_age.csv")
  • Download MS_acs2015_bw.csv:
download.file("https://github.com/cengel/R-data-wrangling/raw/master/data/MS_acs2015_bw.csv",
              "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 (2017): R for Data Science http://r4ds.had.co.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.