| # use moveVis >= 0.10.2 for this example (does not work with CRAN version 0.10.1) | |
| # remotes::install_github("16eagle/moveVis") | |
| library(moveVis) | |
| library(move) | |
| data("move_data") | |
| # align movement to unique times and regular resolution | |
| m <- align_move(m = move_data, digit = 0, res = 4, unit = "mins") | |
| # create frames | |
| # using path_fade = T to let paths disappear towards the last frame and thus only showing traces on the last frame | |
| frames <- frames_spatial(m, map_service = "mapbox", map_type = "satellite", map_token = "YOUR_MAPBOX_TOKEN", | |
| equidistant = F, path_colours = c("red", "green", "blue"), path_fade = T, trace_show = T) %>% | |
| add_labels(x = "Longitude", y = "Latitude") %>% | |
| add_northarrow(colour = "white", position = "bottomright") %>% | |
| add_scalebar(colour = "white", position = "bottomleft") %>% | |
| add_timestamps(type = "label") %>% | |
| add_progress(size = 2) | |
| # animate frames with an end_pause of 2 seconds (holding last frame for 2 seconds) | |
| animate_frames(frames, out_file = "moveVis.gif", | |
| width = 850, height = 550, end_pause = 2, overwrite = T) |
This comment has been minimized.