Title: | Package Accompanying: Space-use and social organization in a gregarious ungulate: testing the conspecific attraction and resource dispersion hypotheses |
---|---|
Description: | Package Accompanying: Space-use and social organization in a gregarious ungulate: testing the conspecific attraction and resource dispersion hypotheses |
Authors: | Mélissa Peignier [aut], Quinn M.R. Webber [aut] , Erin Koen [aut], Michel P. Laforge [aut], Alec L. Robitaille [aut, cre] , Eric Vander Wal [aut] |
Maintainer: | Alec L. Robitaille <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2024-11-21 05:36:04 UTC |
Source: | https://github.com/wildlifeevoeco/SocCaribou |
check col
check_col(DT = NULL, col = NULL, arg = NULL, extra = NULL)
check_col(DT = NULL, col = NULL, arg = NULL, extra = NULL)
DT |
data.table |
col |
column name |
arg |
argument name |
extra |
extras |
Dynamic network
dynamic_network(DT = NULL, id = NULL, by = NULL)
dynamic_network(DT = NULL, id = NULL, by = NULL)
DT |
'data.table“ of relocations. |
id |
individual identifier column name. |
by |
columns in input DT to split home range network generation and comparison by. For example: c('season', 'year') or 'herd'. Expects character vector. |
Graph strength for each individual.
Build home range networks using adehabitatHR::kerneloverlap
and returns either graph statitics or home range overlap.
hr_network(DT = NULL, id = NULL, utm = NULL, by = NULL, returns = NULL)
hr_network(DT = NULL, id = NULL, utm = NULL, by = NULL, returns = NULL)
DT |
'data.table“ of relocations. |
id |
individual identifier column name. |
utm |
proj4string indicating coordinate system of coordinates |
by |
columns in input DT to split home range network generation and comparison by. For example: c('season', 'year') or 'herd'. Expects character vector. |
returns |
either 'network-stats' or 'overlap'. See Details. |
DT
provided with columns EASTING, NORTHING for UTM coordinates. by
argument used to specify grouping. Defaults only (as used in the paper).
graph strength for each individual
Calculate basic step length with data.table
step_length(DT, coords = c("EASTING", "NORTHING"), time = "datetime", splitBy = c("id", "yr"), moverate = FALSE, type = "lag", preserve = FALSE)
step_length(DT, coords = c("EASTING", "NORTHING"), time = "datetime", splitBy = c("id", "yr"), moverate = FALSE, type = "lag", preserve = FALSE)
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. |
# 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'))
# 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'))