
Pairwise Metrics of Collective Motion in a Dataset
Source:R/metrics_calc_pairwise.R
pairwise_metrics.RdThis 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.
Usage
pairwise_metrics(
data_list,
geo = FALSE,
verbose = FALSE,
parallelize = FALSE,
add_coords = FALSE
)Arguments
- data_list
A list of dataframes with groups timeseries per set. Columns must include:
id,t,set,head,x,y.- 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'.
Value
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.
Author
Marina Papadopoulou m.papadopoulou.rug@gmail.com