Skip to contents

Helper to filter sets of sites by median distance among all points

Usage

distance_filter(site_list, median_distance_filter = "max")

Arguments

site_list

list of selected sites provided as data.frames. Columns "Longitude" and "Latitude" are needed for distance calculation.

median_distance_filter

(character) optional argument to define a median distance-based filter based on which sets of sampling sites will be selected. Default = "max". Options are:"max" and "min".

Value

A list of sets of selected sites according to median_distance_filter.

Examples

# Data
m_selection <- read_master(system.file("extdata/m_selection.rds",
                                       package = "biosurvey"))

slist <- m_selection$selected_sites_random

# Distance filter
max_sites <- distance_filter(slist, median_distance_filter = "max")