This function calculates the x and y coordinates of a neighbor in the reference frame of the focal individual.
Usage
add_rel_pos_coords(data, focal_heading = c(0, 1))Value
The input dataframe with additional nnx (nearest neighbor x coordinate)
and nny (nearest neighbor y coordinate) columns.
Author
Marina Papadopoulou m.papadopoulou.rug@gmail.com
Examples
data <- data.frame(
bangl = runif(25, 0, pi),
nnd = runif(25)
)
data <- add_rel_pos_coords(data)
