alternate | R Documentation |
Alternate cfp_pfres()
/ cfp_fgres()
models for sensitivity analysis
and more.
alternate(
x,
f,
run_map,
return_raw = TRUE,
error_funs = NULL,
error_args = NULL
)
alternate_model(run_map, x, f)
x |
A cfp_pfres or cfp_fgres model result. |
f |
A function taking in a soilphys object and recalculates the relevant
columns. See |
run_map |
A data.frame created by |
return_raw |
Should the models be returned as is, or after applying any
|
error_funs |
A list of functions to be applied after flux calculation if
|
error_args |
A list of additional function arguments to be passed to any
of the |
alternate_model()
is used internally to change and rerun one
model, but can also be used to update a model with a given unique run_map,
e.g. by filtering the best run_id from the original run_map
.
A list
of type cfp_altres()
, each entry an
updated model.
PROFLUX <- ConFluxPro::base_dat |>
filter(site == "site_a") |> # use only 'site_a' for example
pro_flux()
# Create a cfp_run_map where TPS is changed between 90 % and 110 %
# of the original value for 2 runs.
my_run_map <-
cfp_run_map(
PROFLUX,
list("TPS" = c(0.9, 1.1)),
"factor",
n_runs = 2)
# run the new models by providing a function `f`
# that updates the soilphys data.frame.
alternate(
x = PROFLUX,
f = \(x) complete_soilphys(x, "a+AFPS^b", quiet = TRUE),
run_map = my_run_map)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.