random_selection {biosurvey}R Documentation

Random selection of survey sites


Random selection of sites to be sampled in a survey. Sites are selected from a set of points provided in master.


random_selection(master, n_sites, n_samplings = 1,
                 use_preselected_sites = TRUE, median_distance_filter = NULL,
                 set_seed = 1, verbose = TRUE, force = FALSE)



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


(numeric) number of sites to be selected from master_matrix to be used as sites to be sampled in survey.


(numeric) number of processes of selection, which will turn into multiple options for a process of survey planning. Default = 1.


(logical) whether to use sites that have been defined as part of the selected sites previous to any selection. Object in master must contain the site(s) preselected in and element of name "preselected_sites" for this argument to be effective. Default = TRUE.


(character) optional argument to define a median distance-based filter based on which sets of sampling sites will be selected. The default, NULL, does not apply such a filter. Options are: "max" and "min".


(numeric) integer value to specify a initial seed. Default = 1.


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


(logical) whether to replace existing set of sites selected with this method in master.


Survey sites are selected randomly from the entire set of points provided in master$data_matrix. Considering the environmental space, as points are selected randomly, sites that have environmental conditions that are common in the region of interest will be sampled more that other sites that present condition that are not as common.

To see how common or rare are distinct environments in the region of interest, the function explore_data_EG can be used. Common environmental conditions are those that are present in areas of higher density in one of the plots obtained with explore_data_EG.

As multiple sets could result from selection, the argument of the function median_distance_filter could be used to select the set of sites with the maximum ("max") or minimum ("min") median distance among selected sites. Option "max" will increase the geographic distance among sampling sites, which could be desirable if the goal is to cover the region of interest more broadly. The other option, "min", could be used in cases when the goal is to reduce resources and time needed to sample such sites.


A master_selection object (S3) with an element called selected_sites_random containing one or more sets of selected sites.

See Also

uniformG_selection, uniformE_selection, EG_selection, plot_sites_EG


# Data
data("m_matrix", package = "biosurvey")

r_selection <- random_selection(m_matrix, n_sites = 20, n_samplings = 5)

[Package biosurvey version 0.1.1 Index]