Last active
June 14, 2019 05:25
-
-
Save mdneuzerling/f716cbbb4455896b90e23cc27fdc5e62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(bomrang) | |
weather <- get_historical( | |
stationid = "090015", | |
type = "max" | |
) | |
weather %>% | |
filter(!is.na(Max_temperature)) %>% # remove missing values | |
mutate( | |
Season = case_when( | |
Month %in% c(12, 1, 2) ~ "Summer", | |
Month %in% c(3, 4, 5) ~ "Autumn", | |
Month %in% c(6, 7, 8) ~ "Winter", | |
Month %in% c(9, 10, 11) ~ "Spring" | |
), | |
Season = factor(Season, levels = c("Summer", "Autumn", "Winter", "Spring")) # ordering | |
) %>% | |
group_by(Year, Season) %>% | |
summarise(Average_max_temp = mean(Max_temperature)) %>% | |
ggplot(aes(x = Year, y = Average_max_temp)) + | |
geom_point() + | |
geom_smooth() + | |
facet_grid(Season ~ .) + | |
ggtitle("Cape Otway Lighthouse seasonal temperatures") |
Author
mdneuzerling
commented
Aug 10, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment