View source: R/BASS_full_run.R
full_BASS_run | R Documentation |
A full BASS run
full_BASS_run(
land_hex,
num_runs,
n_samples,
costs = NULL,
hex_id = hex_id,
stratum_id = NULL,
omit_flag = NULL,
non_random_set = NULL,
benefit_weight = 0.5,
land_cover_weights = NULL,
return_grts = FALSE,
crs = 4326,
coords = c("lon", "lat"),
seed = NULL,
quiet = FALSE,
...
)
land_hex |
(Spatial) Data frame. Land Cover data by hexagon. If
non-spatial, will be converted to spatial sf data frame using the |
num_runs |
Numeric. Number of times to draw random samples. |
n_samples |
Numeric. Number of samples to draw in each run. |
costs |
Data frame. Costs for each hexagon in a RawCost format. |
hex_id |
Column. Identifies hexagon IDs (e.g., default |
stratum_id |
Column. Identifies larger area (e.g., |
omit_flag |
Column identifying hexes to omit (e.g., water hexes). |
non_random_set |
Character vector. |
benefit_weight |
Numeric. Weight assigned to benefit in the selection probabilities. 0.5 is equal weighting of cost and benefits. 1.0 is zero weighting to cost. Default 0.5. |
land_cover_weights |
Data frame. Proportional weights
( |
return_grts |
Logical. Return the |
crs |
Numeric, character, or sf/sfc. Coordinate reference system. Must
be valid input to |
coords |
Character vector. Names of the columns containing X and Y
coordinates (default |
seed |
Numeric. Random seed to use for random sampling. Seed only
applies to specific sampling events (does not change seed in the
environment). |
quiet |
Logical. Whether to suppress progress messages. |
... |
Extra named arguments passed on to |
Data frame of inclusion probabilities. Or, if return_grts = TRUE
a
list including the data frame of inclusion probabilities as well as the
spsurvey
grts sampling object.
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.
# With example data psu_hexagons and psu_costs...
d <- full_BASS_run(
land_hex = psu_hexagons,
num_runs = 10,
n_samples = 3,
costs = psu_costs)
# Omit water hexes
d <- full_BASS_run(
land_hex = psu_hexagons,
num_runs = 10,
n_samples = 3,
costs = psu_costs,
omit_flag = water)
# Keep grts objects
d <- full_BASS_run(
land_hex = psu_hexagons,
num_runs = 10,
n_samples = 3,
costs = psu_costs,
return_grts = TRUE)
names(d)
d[["inclusion_probs"]]
d[["grts_output"]][[1]]
# Change spsurvey::grts() arguments
d <- full_BASS_run(
land_hex = psu_hexagons,
num_runs = 10,
n_samples = 3,
costs = psu_costs,
mindis = 10, maxtry = 10)
d
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.