R Tutorials in Data Science

 

This page presents a series of tutorials and interdisciplinary case studies that can be used in a variety of blended as well as brick-and-mortar courses. The materials can be used in introductory level data science courses as well as more advanced data science or statistics courses. All the RMarkdown (.rmd) files and datasets for the RTutorials are also available on our GitHub site. The GitHub site also includes more advanced case studies for students who have completed these tutorials.

 

These materials assume that students have a basic prior knowledge of R or Rstudio, such as the Getting Started With R material provided by Carleton College.

 

Tutorials:

  • Introduction to Creating Maps with ggplot2: This activity focuses on how to use the maps and ggplot2 packages to create basic state, country and world choropleth maps.

    View Student Handout (HTML) or get in RMarkdown

    State Population Dataset

    Prerequisites: Some experience with ggplot2 and dplyr

     

  • Making Maps with Shapefiles: This activity breifly introduces shapefiles.

    View Student Handout (HTML) or get in RMarkdown

    Dataset: will be available in GitHub

    Prerequisites: Creating maps with ggplot2

     

  • Manipulating Text: This tutorial introduces many of the techniques needed for working with text data.

    View Student Handout (HTML) or get in RMarkdown

    A more complete list of stringr commands (.pdf)

    Created by Laura Chihara

    Prerequisites: Some experience with R or RStudio.

     

  • Working with Dates and Times: This tutorial uses the lubridate package to modify dates.

    View Student Handout (HTML) or get in RMarkdown

    Created by Laura Chihara

    Prerequisites: Some experience with R or RStudio.

  •  

  • Introduction to Data Scraping: In this tutorial, we will learn how to read data from a table on a web page into R. Note that the links in these files will need to be updated whenever the website changes.

    View Student Handout (HTML) or get in RMarkdown

    Created by Laura Chihara

    Prerequisites: Some experience with R or RStudio and the Introduction to Working with Strings tutorial.

     

     

    Additional Resources: Chester Ismay has created an online text, Getting used to R, Rstudio and RMarkdown.

     

    This work represents collaborative work across Grinnell College (Shonda Kuiper), Lawrence University (Adam Loy) and Carleton College (Laura Chihara) funded by grants from the ACM and the Teagle Foundation. This work was also developed through summer research projects with Grinnell students Krit Petrachaianan, Zachary Segall, and Ying Long.