Last active
January 10, 2019 09:22
-
-
Save thomasp85/74bbcf1ff8a3a37f3d2626750e664bdb to your computer and use it in GitHub Desktop.
air quality
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(gganimate) | |
airq <- airquality | |
airq$Month <- format(ISOdate(2004,1:12,1),"%B")[airq$Month] | |
ggplot(airq, aes(Day, Temp, group = Month)) + | |
geom_line() + | |
geom_segment(aes(xend = 31, yend = Temp), linetype = 2, colour = 'grey') + | |
geom_point(size = 2) + | |
geom_text(aes(x = 31.1, label = Month), hjust = 0) + | |
transition_reveal(Day) + | |
coord_cartesian(clip = 'off') + | |
labs(title = 'Temperature in New York', y = 'Temperature (°F)') + | |
theme_minimal() + | |
theme(plot.margin = margin(5.5, 40, 5.5, 5.5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment