This function calculates the bearing angle and distance from a focal individual to its nearest neighbor.
calc_nn_metrics(thists, geo)The input dataframe with new columns for nnd (nearest neighbor distance),
nn_id (its id) and bangl (nearest neighbor bearing angle).
A timestep of individual positions, ids and headings.
Logical, whether positions are geographic coordinates.
Marina Papadopoulou m.papadopoulou.rug@gmail.com