View source: R/calculate_distance.R
calculate_distance | R Documentation |
This function calculates the nearest transect/segment transect_obj for each simulated individual obs_obj. It returns an array with the name of the closest transect/segment for each individual and the distance in m and in km between them.
calculate_distance(obs_obj, transect_obj, crs)
obs_obj |
dataframe. Individuals simulated with their coordinates. |
transect_obj |
sf dataframe. Transect/segments data. |
crs |
numeric. projection system. |
sf dataframe. Distances between individuals and associated transect/segment.
data(dataset_obs) data(dataset_segs) dist <- calculate_distance(obs_obj = dataset_obs, transect_obj = dataset_segs, crs = 2154) head(dist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.