Skip to contents

Subsets of a base_PAM object according to survey sites contained in a master_selection object.

Usage

subset_PAM(base_PAM, master_selection, selection_type = "all")

Arguments

base_PAM

object of class base_PAM obtained using the function prepare_base_PAM.

master_selection

object of class master_selection. This object can be obtained using the functions: random_selection, uniformG_selection, uniformE_selection, or EG_selection.

selection_type

type of selection to be considered to subset base_PAM. Options are: "all", "random", "E", "G", and "EG". The default, "all", uses all selection types present in master_selection.

Value

An object of class PAM_subset containing the original base_PAM and other subsets of the PAM according to selection_type.

Examples

# Data
b_pam <- read_PAM(system.file("extdata/b_pam.rds",
                              package = "biosurvey"))
m_selection <- read_master(system.file("extdata/m_selection.rds",
                                       package = "biosurvey"))

# Subsetting base PAM according to selections
## only uniform in G
sub_pam_G <- subset_PAM(b_pam, m_selection, selection_type = "G")

## All at the time
sub_pam_all <- subset_PAM(b_pam, m_selection, selection_type = "all")