preselected_dist_mask: Helper to create objects to detect points to close to...

Description Usage Arguments Value Examples

View source: R/preselected_dist_mask.R

Description

Helper to create objects to detect points to close to preselected sites

Usage

1
2
3
preselected_dist_mask(master, expected_points, space, variable_1 = NULL,
                      variable_2 = NULL, use_blocks = FALSE,
                      verbose = TRUE)

Arguments

master

master_matrix object derived from function prepare_master_matrix or master_selection object derived from functions random_selection, uniformE_selection, or EG_selection.

expected_points

(numeric) number of survey points (sites) to be selected.

space

(character) space in which the thinning will be performed. There are two options available: "G", if it will be in geographic space, and "E", if it will be in environmental space.

variable_1

(character or numeric) name or position of the first variable (x-axis). Default = NULL.

variable_2

(character or numeric) name or position of the second variable (y-axis). Default = NULL.

use_blocks

(logical) whether or not to use block centroids instead of all points when space = "E". Default = FALSE.

verbose

(logical) whether or not to print messages about the process. Default = TRUE.

Value

A list of two elements: the distance used to obtain expected_points and a SpatialPolygonsDataFrame object created from preselected_sites in master.

Examples

1
2
3
4
5
6
# Data
data("m_matrix_pre", package = "biosurvey")

# Running
pdm <- preselected_dist_mask(master = m_matrix_pre, expected_points = 20,
                             space = "G")

biosurvey documentation built on Sept. 16, 2021, 1:07 a.m.