calc_nn_metrics: Relative Position of Nearest Neighbor Function to Parallelize

View source: R/metrics_calc_pairwise.R

calc_nn_metricsR Documentation

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)

Arguments

thists

A timestep of individual positions, ids and headings.

geo

Logical, whether positions are geographic coordinates.

Value

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

Author(s)

Marina Papadopoulou m.papadopoulou.rug@gmail.com


swaRmverse documentation built on Oct. 10, 2024, 5:08 p.m.