Week 3

Lab 2

Monday, Sep 9

GitHub


Subsetting and S3 objects

Tuesday, Sep 10

Learning objectives

  • Subset matrices, arrays, and data frames
  • Argument drop in subsetting
  • Subassignment
  • S3 object oriented programming system
  • Create generics and methods
  • Package sloop

Materials


Package ggplot2

Thursday, Sep 12

Learning objectives

  • Understand ggplot anatomy
  • Plot aesthetics
  • Plot facets
  • Best practices for visualizations

Materials


Exercise of the week

To get started, load package tidyverse, and load the flint.csv data set available on GitHub.

library(tidyverse)
flint <- read_csv("https://raw.githubusercontent.com/sta523-fa19/data/master/flint.csv")

Recreate the plot below using package ggplot2.

Some details to help you replicate the plot:

  • remove zip codes 48529 and 48502
  • color choices: red, “#256d7b”
  • font size: 16
  • theme_bw()
Previous
Next