calculate_distance: Calculate distance between transects and points

View source: R/calculate_distance.R

calculate_distanceR Documentation

Calculate distance between transects and points

Description

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.

Usage

calculate_distance(obs_obj, transect_obj, crs)

Arguments

obs_obj

dataframe. Individuals simulated with their coordinates.

transect_obj

sf dataframe. Transect/segments data.

crs

numeric. projection system.

Value

sf dataframe. Distances between individuals and associated transect/segment.

Examples


data(dataset_obs)
data(dataset_segs)

dist <- calculate_distance(obs_obj = dataset_obs, 
                           transect_obj = dataset_segs, 
                           crs = 2154)

head(dist)

maudqueroue/intercali documentation built on Oct. 8, 2022, 2:09 p.m.