View source: R/BASS_studyArea_analysis.R
run_grts_on_BASS | R Documentation |
Sample sites based on the cost/benefit probabilities calculated in previous steps. Sites can be sampled with or without stratification.
run_grts_on_BASS(
probs,
nARUs,
os = NULL,
num_runs = 1,
hex_id = NULL,
stratum_id = NULL,
remove_hexes = NULL,
selection_weighting = inclpr,
seed = NULL,
...
)
probs |
Data frame. Output of |
nARUs |
Numeric, Data frame, Vector, or List. Number of base samples to
choose. For stratification, a named vector/list of samples per stratum, or
a data frame with columns |
os |
Numeric, Vector, or List. Over sample size (proportional) or named
vector/list of number of samples per stratum. Ignored if |
num_runs |
Numeric. Number of times to draw random samples. |
hex_id |
Column. Identifies hexagon IDs (e.g., default |
stratum_id |
Column. Identifies larger area (e.g., |
remove_hexes |
Character Vector. Ids of hexagons to remove prior to sampling. |
selection_weighting |
Column. Identifies selection weightings used by
the |
seed |
Numeric. Random seed to use for random sampling. Seed only
applies to specific sampling events (does not change seed in the
environment). |
... |
Extra named arguments passed on to |
If num_runs
is 1, a single spsurvey
object, otherwise a list of
spsurvey
objects.
Extra named arguments for spsurvey::grts()
can also be passed on via ...
.
In particular, note that the default values for mindis
(minimum distance
between sites) is NULL
, and maxtry
(maximum attempts to try to obtain the
minimum distance between sites) is 10.
d <- full_BASS_run(
land_hex = psu_hexagons,
num_runs = 10,
n_samples = 3,
costs = psu_costs)
# Simple selection
sel <- run_grts_on_BASS(
probs = d,
nARUs = 5,
os = 0.2)
# Stratify
d <- dplyr::mutate(d, Province = c(rep("ON", 16), rep("MB", 17))) # Add Strata
# With lists...
sel <- run_grts_on_BASS(
probs = d,
nARUs = list("ON" = 5, "MB" = 2),
stratum_id = Province,
os = 0.2)
# With data frame...
sel <- run_grts_on_BASS(
probs = d,
nARUs = data.frame(Province = c("ON", "MB"),
n = c(5, 2),
n_os = c(1, 1)),
stratum_id = Province)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.