To animate the locations, we first need to create a time stamp variable of class numeric or POSIX. One advantage to using the POSIX class is that we can specify the gaps in the interpolation (delta.t) using convenient character strings like "hour" or "week".

The animation isn’t much good without context, so we add a simple map. There are lots of ways to incorporate a map. The simplest way is to set background to TRUE, in which case anipaths will do the best it can to select a map based on the data. In the next example, we’ve changed the time step to help the animations load a little faster.

You can also give a long/lat location, zoom level (3-21; see ?ggmap::get_map()), and maptype (satellite, terrain, hybrid) to be passed to ggmap::get_map(), and anipaths will make a background for you. As shown below, the value of delta.t can be specified as a numeric, which will be interpreted in whatever units used by as.numeric(paths['Time.name']) (in our case, this is seconds).