Description Usage Arguments Value Examples
View source: R/selection_helpers.R
Point thinning based on user-defined distances in geographic or environmental space.
1 2 | point_thinning(data, x_column, y_column, thinning_distance, space,
max_n_samples = 1, replicates = 10, set_seed = 1)
|
data |
matrix or data.frame that contains at least two columns. |
x_column |
(character) the name of the x-axis. |
y_column |
(character) the name of the y-axis. |
thinning_distance |
(numeric) distance for thinning. Units must be selected according to the space, kilometers (km) for geographic and Euclidean distances for environmental space. |
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. |
max_n_samples |
(numeric) maximum number of samples to chose with most points included. Default = 1. |
replicates |
(numeric) number of thinning replicates. Default = 10. |
set_seed |
(numeric) integer value to specify a initial seed. Default = 1. |
A list with one or more elements, depending on max_n_samples
. Each
element is a data.frame containing points retained after thinning. All
elements are different in at least one of the selected points.
1 2 3 4 5 6 7 8 | # Data
data("m_matrix", package = "biosurvey")
data1 <- m_matrix$data_matrix
# Thinning the points
thin <- point_thinning(data1, x_column = "Longitude", y_column = "Latitude",
thinning_distance = 200, space = "G",
max_n_samples = 1, replicates = 5, set_seed = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.