A handy and interactive plotter for solo or group GPS tracks. Uses ggmaps to produce images or videos of animal trajectories on a googlemaps background.
1 2 3 4 5 | plot_map(data, type = c("solo", "group"), image.or.vid = "image",
tail.size = 20, frame.size = 1, wd = getwd(), plot_name = "my_plot",
lines.or.points = "lines", col = "red", axis.nums.size = 12,
axis.labs.size = 14, n.indiv = NULL, lwd = 2, file.to.folder = T,
centre = NA, maptype = "satellite", zoom = 19)
|
data |
data frame or list of data frames with 2 dimensions: longitude & latitude (in that order; columns) For group plots, ensure data frames in the list have the same number of rows |
type |
Solo or Group plots. |
image.or.vid |
"image" or "video" (sequence of images) to be produced |
tail.size |
animals represented by current position and the previous n positions (video only) |
frame.size |
plot every row of data, or every 1/frame size for shorter running speeds and output files (video only) |
wd |
Specify the working directory that you would like to save the plots into. |
lines.or.points |
On the plotted map, animal trajectory represented by either "lines" or "points" |
col |
Colour of plotted trajectory (solo only) |
n.indiv |
Number of individuals. Only use in group context. |
lwd |
Thickness of line |
file.to.folder |
TRUE if you want to make videos when happy with other params, but for testing videos set to FALSE |
centre |
Choose your own centre points for the mapform: c(lon, lat) |
maptype |
"satellite" is default, though check ?get_map in the ggmap package for more options |
zoom |
zoom = 19 is good for video. Other plot types are worth playing around with, try 13 for approx 5 km square |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.