feasible_survey_schemes {surveyvoi} | R Documentation |
Find all feasible survey schemes
Description
Generate a matrix
representing all possible different
survey schemes given survey costs and a fixed budget.
Usage
feasible_survey_schemes(
site_data,
cost_column,
survey_budget,
locked_in_column = NULL,
locked_out_column = NULL,
verbose = FALSE
)
Arguments
site_data |
|
cost_column |
|
survey_budget |
|
locked_in_column |
|
locked_out_column |
|
verbose |
|
Value
A matrix
where each row corresponds to a different
survey scheme, and each column corresponds to a different planning unit.
Cell values are logical
(TRUE
/ FALSE
) indicating
if a given site is selected in a given survey scheme.
Dependencies
Please note that this function requires the Gurobi optimization software (https://www.gurobi.com/) and the gurobi R package if different sites have different survey costs. Installation instruction are available online for Linux, Windows, and Mac OS (see https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer).
Examples
## Not run:
# set seed for reproducibility
set.seed(123)
# simulate data
x <- sf::st_as_sf(tibble::tibble(x = rnorm(4), y = rnorm(4),
cost = c(100, 200, 0.2, 1)),
coords = c("x", "y"))
# print data
print(x)
# plot site locations
plot(st_geometry(x), pch = 16, cex = 3)
# generate all feasible schemes given a budget of 4
s <- feasible_survey_schemes(x, "cost", survey_budget = 4)
# print schemes
print(s)
# plot first scheme
x$scheme_1 <- s[1, ]
plot(x[, "scheme_1"], pch = 16, cex = 3)
## End(Not run)