Skip to content

Instantly share code, notes, and snippets.

J. Schwalb-Willmann 16EAGLE

View GitHub Profile
@16EAGLE
16EAGLE / moveVis_show_traces.R
Last active Apr 15, 2019
Short moveVis example on how to display the full traces of each path using trace_show and trace_colour with frames_spatial()
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")
@16EAGLE
16EAGLE / moveVis_colours_by_change_points.R
Last active Apr 15, 2019
Short moveVis example on how to assign multiple path colours per individual to indicate e.g. behavioral segments
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)
@16EAGLE
16EAGLE / moveVis_overlay_base_map_with_transparent_rasters.R
Created Mar 7, 2019
Short moveVis example on how to overlay frames with additional transparent rasters changing over time
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)
@16EAGLE
16EAGLE / moveVis_get_coordinates_per_frame.R
Created Mar 7, 2019
Short moveVis example on how to create a data.frame containing each track coordinate per frame
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
@16EAGLE
16EAGLE / moveVis_adapt_legend.R
Last active Mar 7, 2019
Short moveVis example on how to adapt the path legend of frames created with frames_spatial()
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
You can’t perform that action at this time.