Professional Documents
Culture Documents
/usr/bin/env Rscript
# This R script is to read the indego file and create a gif images
# importing libraries:
library(ggplot2)
library(ggmap)
register_google(key = "AIzaSyA46DHNeClnrzlw5y5qgF0aM-3-pUmwc54")
library(gganimate)
library(lubridate)
# add to map:
ggm <- ggmap(philadelphia) + geom_point(data = indego,aes(x = start_lon, y = start_lat,
colour = bike_type, group = bike_type, shape = passholder_type), size = 3, alpha = 0.8) +
transition_time(duration) +
labs(title = paste("duration", "{round(frame_time,0)}")) +
shadow_wake(wake_length = 0.1)
animate(ggm, fps = 24, duration = 16)
anim_save("bike.gif", ggm)