powered by
This function calculates and adds the speed and heading of each individual over time in the dataset, and splits it in a list of dataframes based on the defined sets.
add_velocities(data, geo = FALSE, verbose = FALSE, parallelize = FALSE)
A list of dataframes, an element per set from the input dataframe with new columns: head and speed.
head
speed
A data frame with time series of individual's positional data, as exported by the set_data_format function. Columns needed: set, t, id, x, y.
set_data_format
set
t
id
x
y
Logical, whether positions are geographic coordinates, default = FALSE.
Logical, whether to post updates on progress, default = FALSE.
Logical, whether to run the function in parallel over individuals, default = FALSE.
Marina Papadopoulou m.papadopoulou.rug@gmail.com
add_set_vels, set_data_format
add_set_vels
data <- data.frame( set = rep(1, 25), x = rnorm(25, sd = 3), y = rnorm(25, sd = 3), t = as.POSIXct(1:25, origin = Sys.time()), id = rep(1, 25) ) data_list <- add_velocities(data, geo = FALSE)
Run the code above in your browser using DataLab