October 4 Open House

Harold Nelson

10/4/2018

How’s the Weather?

This little presentation looks at weather for the Olympia area. If you’re new, what should you expect over the next few months?

I thought that last July was unusually hot. Was it different?

The Data

The dataset contains daily observations of weather from July 1948 forward.

summary(olyw1018)
##  STATION_NAME            DATE                 PRCP       
##  Length:28686       Min.   :1948-01-01   Min.   :0.0000  
##  Class :character   1st Qu.:1959-10-07   1st Qu.:0.0000  
##  Mode  :character   Median :1979-05-26   Median :0.0000  
##                     Mean   :1980-03-14   Mean   :0.1405  
##                     3rd Qu.:1999-01-25   3rd Qu.:0.1400  
##                     Max.   :2018-09-21   Max.   :4.8200  
##       SNOW               TMAX             TMIN             yr      
##  Min.   : 0.00000   Min.   : 18.00   Min.   :-8.00   Min.   :1948  
##  1st Qu.: 0.00000   1st Qu.: 50.00   1st Qu.:33.00   1st Qu.:1959  
##  Median : 0.00000   Median : 59.00   Median :40.00   Median :1979  
##  Mean   : 0.03355   Mean   : 60.46   Mean   :39.85   Mean   :1980  
##  3rd Qu.: 0.00000   3rd Qu.: 71.00   3rd Qu.:47.00   3rd Qu.:1999  
##  Max.   :14.20000   Max.   :104.00   Max.   :69.00   Max.   :2018  
##        mo               dy       
##  Min.   : 1.000   Min.   : 1.00  
##  1st Qu.: 4.000   1st Qu.: 8.00  
##  Median : 7.000   Median :16.00  
##  Mean   : 6.502   Mean   :15.72  
##  3rd Qu.: 9.000   3rd Qu.:23.00  
##  Max.   :12.000   Max.   :31.00

Prediction

Let’s create a permanent weather prediction for any future year based on average historical values for each day.

All of the Data

Here’s a graph showing all of the historical values.

2018 Enhanced

Here’s the same graph with 2018 values enhanced.

cal18 = filter(olyw1018,yr == 2018) %>% 
        mutate(date =make_date(2020,mo,dy))
cal20_all %>% 
  ggplot(aes(x=date,y=TMAX)) +
  geom_point(alpha=.1,size=.5) +
  geom_point(data=cal18,aes(date,TMAX),alpha=.8,color="red",size=.6) +
  ggtitle("All Daily Maximum Temperatures") +
  theme(plot.title = element_text(hjust = 0.5))