View moveVis_add_custom_map_service.R
library(moveVis) | |
# example data | |
data("move_data") | |
m <- align_move(m = move_data, res = 4, unit = "mins") | |
# add new service to moveVis, e.g. an ESRI layer | |
services <- getOption("moveVis.map_api") | |
services$esri <- list(hillshade = "https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer/tile/") | |
options(moveVis.map_api = services) |
View moveVis_colours_by_variable.R
# use moveVis >= 0.10.2 for this example | |
library(moveVis) | |
library(move) | |
library(plyr) | |
# get example data. align movement to unique times and regular resolution | |
data("move_data") | |
m.aligned <- align_move(move_data, res = 4, unit = "mins") | |
# let's create some fake continous variable by splitting the moveStack into single tracks |
View moveVis_hold_last_frame.R
# 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") |
View moveVis_show_traces.R
# 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") |
View moveVis_colours_by_change_points.R
# use moveVis >= 0.10.1 for this example | |
library(moveVis) | |
library(move) | |
data("move_data") | |
# align movement to unique times and regular resolution | |
m.aligned <- align_move(move_data, res = 4, unit = "mins") | |
m.split <- split(m.aligned) |
View moveVis_overlay_base_map_with_transparent_rasters.R
library(moveVis) | |
library(move) | |
library(ggplot2) | |
data("move_data", "basemap_data") | |
m <- align_move(move_data, res = 4, unit = "mins") | |
## create frames using mapbox base map | |
frames <- frames_spatial(m, map_type = "satellite", map_service = "mapbox", map_token = "YOUR_VERY_LONG_TOKEN", | |
path_legend = T) |
View moveVis_get_coordinates_per_frame.R
# this example uses internal functions since there are no user functions yet to do this | |
library(moveVis) | |
data("move_data") | |
m <- align_move(move_data, res = 4, unit = "mins") | |
# m must be aligned, check (returns an error, if m is not aligned, does nothing, if m is aligned) | |
moveVis:::.time_conform(m) | |
# if you are certain, m is the same variable you used with frames_spatial, you can remove line 9 |
View moveVis_adapt_legend.R
library(moveVis) | |
library(move) | |
library(ggplot2) | |
data("move_data") | |
# align movement to unique times and regular resolution | |
m <- align_move(move_data, res = 4, unit = "mins") | |
# some path colours by individual | |
m.list <- split(m) # split m into list by individual |