Slide 27
Slide 27 text
The possibilities are endless
# Development versions of both
library(ggmap)
library(gganimate)
airbnb_plot "<- airbnb %>%
# Index by hour
index_by(hourly = floor_date(last_modified, "hour")) %>%
# Throw out a few outliers
filter(
between(price, quantile(price, .05), quantile(price, .95))
) %>%
# Map and animate
qmplot(longitude, latitude, data = ., geom = "blank") +
geom_point(
aes(color = price, size = price),
alpha = .5
) +
scale_color_continuous(low = "red", high = “blue") +
transition_manual(hourly) +
labs(title = "{current_frame}")
animate(airbnb_plot)