| block_sample | R Documentation |
Select a user-defined number of blocks in environmental space to be used in further analysis to define sampling sites for a survey system.
block_sample(master, expected_blocks, selection_type = "uniform",
replicates = 10, set_seed = 1)
master |
master_matrix object derived from the function
|
expected_blocks |
(numeric) number of blocks to be selected. |
selection_type |
(character) type of selection. Two options are available: "uniform" and "random". Default = "uniform". |
replicates |
(numeric) number of thinning replicates performed to select blocks uniformly. Default = 10. |
set_seed |
(numeric) integer value to specify a initial seed. Default = 1. |
When blocks in master are defined using the option "equal_points"
(see make_blocks), "uniform" selection_type could
result in blocks with high density per area being overlooked.
An S3 object of class master_matrix or master_selection, containing the same elements found in the input object, with an additional column in the master_matrix data.frame containing a binary code for selected (1) and non-selected (0) blocks.
# Data
m_matrix <- read_master(system.file("extdata/m_matrix.rds",
package = "biosurvey"))
# Making blocks for analysis
m_blocks <- make_blocks(m_matrix, variable_1 = "PC1",
variable_2 = "PC2", n_cols = 10, n_rows = 10,
block_type = "equal_area")
# Selecting blocks uniformly in E space
block_sel <- block_sample(m_blocks, expected_blocks = 10,
selection_type = "uniform")
head(block_sel$data_matrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.