add_velocities | R Documentation |
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)
data |
A data frame with time series of individual's positional data,
as exported by the |
geo |
Logical, whether positions are geographic coordinates, default = FALSE. |
verbose |
Logical, whether to post updates on progress, default = FALSE. |
parallelize |
Logical, whether to run the function in parallel over individuals, default = FALSE. |
A list of dataframes, an element per set from the input dataframe
with new columns: head
and speed
.
Marina Papadopoulou m.papadopoulou.rug@gmail.com
add_set_vels
, set_data_format
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.