Learn R Programming

swaRmverse (version 0.1.0)

calc_nn_metrics: Relative Position of Nearest Neighbor Function to Parallelize

Description

This function calculates the bearing angle and distance from a focal individual to its nearest neighbor.

Usage

calc_nn_metrics(thists, geo)

Value

The input dataframe with new columns for nnd (nearest neighbor distance), nn_id (its id) and bangl (nearest neighbor bearing angle).

Arguments

thists

A timestep of individual positions, ids and headings.

geo

Logical, whether positions are geographic coordinates.

Author

Marina Papadopoulou m.papadopoulou.rug@gmail.com