Skip to contents

[Deprecated]

run_map() was deprecated in favor of cfp_run_map for consistency.

Create a cfp_run_map for model alteration in alternate()

Usage

run_map(
  x,
  params = list(),
  type = NULL,
  method = NULL,
  n_runs = NULL,
  layers_different = FALSE,
  layers_from = "layers_map",
  layers_altmap = NULL,
  topheight_adjust = FALSE
)

Arguments

x

Either a cfp_pfres or cfp_fgres model result.

params

A named list of numeric vectors. Names indicate column names in soilphys, vectors either distinct values (method permutation) or limits (method random).

type

A vector of length param indicating what the values in params represent. One of

abs

Absolute values that are applied as-is.

factor

Factors to be multiplied with the original values.

addition

Factors to be added to the original values.

method

Either 'random', where a random value is chosen within the bounds set in params or 'permutation', where every permutation of the values in params is added.

n_runs

Integer value of the number of alterations to be done for method = 'random'.

layers_different

Should layers from layers_map be changed individually? If TRUE this allows for different changes at different depths.

layers_from

(character) If layers_different is TRUE, from which source should the layers be created? One of:

layers_map

(default) Use the layers that are defined in layers_map.

soilphys

Use the layers as defined in soilphys

layers_altmap

Use the layers as defined in the provided layers_altmap object.

layers_altmap

An optional layers_map created using layers_map() that defines the layers to be used if layers_different = TRUE.

topheight_adjust

(logical) If the proposed change in topheight is larger than the highest layer in soilphys, should the limits be automatically adjusted per id_cols individually? Default is FALSE, which leads to an error in that case.

Value

An object of type cfp_run_map that can be used within alternate.

Examples

PROFLUX <- ConFluxPro::base_dat |> pro_flux()
# Create a cfp_run_map where TPS is changed between 90 % and 110 %
# of the original value for 50 runs.
cfp_run_map(
  PROFLUX,
  list("TPS" = c(0.9, 1.1)),
  "factor",
  n_runs = 50)
#> 
#> A cfp_run_map to be used in alternate(). 
#> number of runs:  50 
#> parameters to alternate:
#>   param param_id
#> 1   TPS        1
#>    run_id param     value   type gas param_id
#> 1       1   TPS 0.9915484 factor CO2        1
#> 2       2   TPS 1.0438225 factor CO2        1
#> 3       3   TPS 1.0869344 factor CO2        1
#> 4       4   TPS 0.9510858 factor CO2        1
#> 5       5   TPS 0.9924586 factor CO2        1
#> 6       6   TPS 1.0880029 factor CO2        1
#> 7       7   TPS 1.0956453 factor CO2        1
#> 8       8   TPS 0.9234975 factor CO2        1
#> 9       9   TPS 0.9949994 factor CO2        1
#> 10     10   TPS 1.0120665 factor CO2        1
#> 11     11   TPS 1.0808063 factor CO2        1
#> 12     12   TPS 0.9277420 factor CO2        1
#> 13     13   TPS 1.0977783 factor CO2        1
#> 14     14   TPS 1.0893336 factor CO2        1
#> 15     15   TPS 0.9164875 factor CO2        1
#> 16     16   TPS 1.0028424 factor CO2        1
#> 17     17   TPS 0.9780407 factor CO2        1
#> 18     18   TPS 1.0811476 factor CO2        1
#> 19     19   TPS 0.9893939 factor CO2        1
#> 20     20   TPS 1.0672009 factor CO2        1
#> 21     21   TPS 1.0475191 factor CO2        1
#> 22     22   TPS 1.0622110 factor CO2        1
#> 23     23   TPS 0.9776217 factor CO2        1
#> 24     24   TPS 1.0370339 factor CO2        1
#> 25     25   TPS 0.9007897 factor CO2        1
#> 26     26   TPS 1.0665832 factor CO2        1
#> 27     27   TPS 0.9014668 factor CO2        1
#> 28     28   TPS 0.9415318 factor CO2        1
#> 29     29   TPS 1.0813203 factor CO2        1
#> 30     30   TPS 1.0223557 factor CO2        1
#> 31     31   TPS 0.9759118 factor CO2        1
#> 32     32   TPS 0.9871543 factor CO2        1
#> 33     33   TPS 0.9074862 factor CO2        1
#> 34     34   TPS 1.0947080 factor CO2        1
#> 35     35   TPS 0.9863502 factor CO2        1
#> 36     36   TPS 1.0915153 factor CO2        1
#> 37     37   TPS 1.0775510 factor CO2        1
#> 38     38   TPS 1.0279958 factor CO2        1
#> 39     39   TPS 1.0941933 factor CO2        1
#> 40     40   TPS 1.0237676 factor CO2        1
#> 41     41   TPS 0.9666854 factor CO2        1
#> 42     42   TPS 0.9693496 factor CO2        1
#> 43     43   TPS 0.9796971 factor CO2        1
#> 44     44   TPS 1.0569386 factor CO2        1
#> 45     45   TPS 0.9077873 factor CO2        1
#> 46     46   TPS 1.0497591 factor CO2        1
#> 47     47   TPS 1.0354554 factor CO2        1
#> 48     48   TPS 0.9342529 factor CO2        1
#> 49     49   TPS 0.9522176 factor CO2        1
#> 50     50   TPS 1.0028826 factor CO2        1