February 11, 2017

Data Preparation

From the airquality dataset in base R, I'd like to graph daily temperatures by month from May to September. First, I need to organize the temperature data by month to more easily graph on the next slide.

##   Day May June July August September
## 1   1  67   78   84     81        91
## 2   2  72   74   85     81        92
## 3   3  74   67   81     82        93
## 4   4  62   84   84     86        93
## 5   5  56   85   83     85        87
## 6   6  66   79   83     87        84

Plot of Daily Temperatures

Analysis

July and August were the hottest months on average, with average temperature of almost 84 degrees. The hottest day in this period was recorded in August at 97 degrees, whereas the coolest was 56 degrees in May.

## # A tibble: 5 × 4
##   Month     mean   max   min
##   <int>    <dbl> <int> <int>
## 1     5 65.54839    81    56
## 2     6 79.10000    93    65
## 3     7 83.90323    92    73
## 4     8 83.96774    97    72
## 5     9 76.90000    93    63