Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Short moveVis example on how to display the full traces of each path using trace_show and trace_colour with frames_spatial()
# use moveVis >= 0.10.2 for this example (does not work with CRAN version 0.10.1)
# remotes::install_github("16eagle/moveVis")
library(magrittr)
library(move)
library(moveVis)
data("move_data")
m <- align_move(move_data, res = 4, unit = "mins")
frames <- frames_spatial(m, map_service = "mapbox", map_type = "satellite", map_token = "YOUR_MAPBOX_TOKEN",
path_colours = c("red", "green", "blue"), tail_colour = "white", tail_size = 0.8,
trace_show = T, trace_colour = "white", equidistant = F) %>%
add_labels(x = "Longitude", y = "Latitude") %>%
add_northarrow(colour = "white") %>%
add_scalebar(colour = "white") %>%
add_timestamps(m, type = "label") %>%
add_progress()
animate_frames(frames, out_file = "/full/path/to/file/moveVis_with_trace.gif",
width = 800, height = 550, res = 95,
overwrite = T)
@16EAGLE

This comment has been minimized.

Copy link
Owner Author

@16EAGLE 16EAGLE commented Apr 15, 2019

result

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Mar 18, 2020

Is there a way to customize the color of the trace based on some values(e.g. I have concentrations of pollutants along the track). Thanks.

@Arcticpaws

This comment has been minimized.

Copy link

@Arcticpaws Arcticpaws commented Mar 14, 2021

How can I have the trace_colour the same colour as the associated path_colour when I have multiple animals on the same map? I have seen maps that are that way (same trace_colour as path_colour for each animal) but I could not find to way to do it. I would really appreciate some help, many thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment