View source: R/metrics_calc_pairwise.R
pairwise_metrics | R Documentation |
This function calculates the bearing angle and distance from each focal individual of a group to its nearest neighbor over time, across the sets of a dataset.
pairwise_metrics(
data_list,
geo = FALSE,
verbose = FALSE,
parallelize = FALSE,
add_coords = FALSE
)
data_list |
A list of dataframes with groups timeseries per set.
Columns must include: |
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 timesteps, default = FALSE. |
add_coords |
Logical, whether data on relative positions are converted into geographic coordinates, default = 'FALSE'. |
A dataframe format of the input list, with new columns for nearest neighbor id (nn_id
),
bearing angles (bangl
), and distances (nnd
). If add_coords
is TRUE, the columns
nnx
and nny
are also added.
Marina Papadopoulou m.papadopoulou.rug@gmail.com
nn_metrics, group_metrics_per_set
data <- data.frame(
set = rep("1", 50),
t = as.POSIXct(rep(1:25, 2), origin = Sys.time()),
id = c(rep(1, 25), rep(2, 25)),
x = rnorm(50),
y = rnorm(50),
head = runif(50, 0, 2 * pi)
)
pm <- pairwise_metrics(list(data), geo = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.