I would like to build an animated map with a time cursor in R.
I have time series (xts) that I would like to represent on map.
library(xts)
library(leaflet)
date<-seq(as.POSIXct("2015-01-01"), as.POSIXct("2015-01-10"), by=86400)
a<-xts(1:10,order.by=date)
b<-xts(5:14,order.by=date)
df = data.frame(Lat = 1:10, Long = rnorm(10),Id=letters[1:10])
leaflet() %>% addCircles(data = df,popup =df$Id)
#popup =paste(df$Id, xts value) time cursor on the map
Is there a way to do this with the leaflet package? I didn't try rmaps package yet.
Thanks
There is a simple example
Library:
Data:
shinyapp: