Push the knit button!

library(tidyverse) # contains ggplot2, dplyr, tidyr, etc
library(agridat) # for `nass.wheat`, `nass.corn`, `nass.soybean` datasets
library(catdata) # for `heart` data

nass.wheat, nass.corn, nass.soybean dataset

glimpse(nass.wheat)
## Rows: 5,963
## Columns: 4
## $ year  <int> 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 186…
## $ state <fct> Alabama, Arkansas, California, Connecticut, Delaware, Georgia, …
## $ acres <dbl> 125000, 50000, 650000, 2000, 59000, 245000, 2300000, 1550000, 1…
## $ yield <dbl> 5.0, 6.5, 18.0, 17.5, 11.0, 4.0, 10.5, 10.0, 13.0, 19.0, 6.5, 1…
glimpse(nass.corn)
## Rows: 6,381
## Columns: 4
## $ year  <int> 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 186…
## $ state <fct> Alabama, Arkansas, California, Connecticut, Delaware, Florida, …
## $ acres <dbl> 1050000, 280000, 42000, 57000, 200000, 125000, 1770000, 4925000…
## $ yield <dbl> 9.0, 18.0, 28.0, 34.0, 23.0, 9.0, 6.0, 29.0, 36.5, 32.0, 28.0, …
glimpse(nass.soybean)
## Rows: 2,528
## Columns: 4
## $ year  <int> 1924, 1924, 1924, 1924, 1924, 1924, 1924, 1924, 1924, 1924, 192…
## $ state <fct> Alabama, Arkansas, Delaware, Georgia, Illinois, Indiana, Iowa, …
## $ acres <dbl> 3000, 3000, 12000, 10000, 115000, 66000, 10000, 2000, 9000, 800…
## $ yield <dbl> 6.5, 6.5, 11.0, 5.5, 12.0, 9.9, 12.0, 11.0, 9.5, 8.0, 11.8, 13.…

Exercise 2.1