Description Usage Arguments Value Examples
View source: R/selectionEG_helpers.R
Sample one or more points from a two dimensional environmental space according to a selection rule and with the possibility of having distinct sets of points to be sampled independently.
1 2 | point_sample(data, variable_1, variable_2, n = 1,
select_point = "E_centroid", id_column = NULL)
|
data |
matrix or data.frame that contains at least four columns: "Longitude" and "Latitude" to represent geographic position, and two other columns to represent the variables of the 2D environmental space. |
variable_1 |
(character or numeric) name or position of the first variable (x-axis). |
variable_2 |
(character or numeric) name or position of the second variable (y-axis). Must be different from the first one. |
n |
(numeric) number of points to be selected. If |
select_point |
(character) how or which point will be selected. Three options are available: "random", "E_centroid", and "G_centroid". E_ or G_ centroid indicate that the point(s) closest to the respective centroid will be selected. Default = "E_centroid". |
id_column |
(character or numeric) name or numeric index of the column
in |
A data.frame containing n
rows corresponding to the point or points
that were sampled.
1 2 3 4 5 6 7 8 9 10 | # Data
data("m_matrix", package = "biosurvey")
# Sampling points
points_s <- point_sample(m_matrix$data_matrix,
variable_1 = "Max_temperature",
variable_2 = "Min_temperature", n = 1,
select_point = "E_centroid", id_column = NULL)
points_s
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.