Description Usage Arguments Examples
Calculate basic step length with data.table
1 2 3 |
DT |
data.table |
coords |
character vector, length 2, coordinate column names. UTM required. |
time |
character time column name. |
splitBy |
character vector of column names to split step length calculation by. default is id and yr (individual identifier and year as numeric). |
moverate |
calculate movement rate? stepLength / dif time, unit hours. |
type |
default: lag. alternative: lead. |
preserve |
preserve intermediate cols? default: no. |
1 2 3 4 5 6 7 8 9 10 11 | # Load data.table
library(data.table)
# Read example data
DT <- fread(system.file("extdata", "DT.csv", package = "toast"))
DT[, datetime := as.POSIXct(datetime)]
DT[, yr := year(datetime)]
step_length(DT, coords = c('X', 'Y'), splitBy = c('ID', 'yr'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.