Skip to contents

Using camera trap locations generated with camtrapmonitoring functions sample_ct() and grid_ct(), evalaute the distance between features and camera trap locations to characterize and select locations, and quantify potential sampling bias.

Usage

eval_dist(features, target, measure = NULL)

Arguments

features

sf features (see sf::st_sf())

target

sf feature target (see sf::st_sf())

measure

measure type see geodist::geodist() for details

Value

vector of distances between target and features

Details

To avoid the large overhead of creating distance to rasters for small/medium number of sample points, this function uses the vector-based distance approach from distanceto::distance_to(). It determines the nearest feature to each target then calculates the distance between each pair.

See also

Other eval: eval_buffer(), eval_pt()

Examples

data("clearwater_lake_density")
data("clearwater_lake_wetlands")

# Sample points
pts <- sample_ct(region = clearwater_lake_density, 1, type = 'random')

# Make grid with queen's case
queen <- grid_ct(features = pts, case = 'queen', distance = 100)

# Evaluate each point with the land cover layer
queen$dist_wetland <- eval_dist(features = queen, target = clearwater_lake_wetlands)

# Plot
plot(queen["dist_wetland"])