This function automates a simple sensitivity analysis for your SWAP project.

check_swap_sensitivity(
  project_path,
  variable,
  values,
  row = NULL,
  statistic = NULL,
  obs_variable = NULL,
  depth = NULL,
  cleanup = TRUE,
  swap_file = "swap.swp",
  n_cores = NULL,
  autoset_output = FALSE,
  force = TRUE,
  verbose = FALSE,
  timeout = Inf
)

Arguments

project_path

path to the project directory (string)

variable

SWAP parameter to alter (string)

values

Parameter set to vary your variable across (vector)

row

(optional, numeric) if your parameter is stored in a table you need to pass the row in which it is in

statistic

(optional, string) if you would like to evaluate the sensitivity of model performance to the passed parameter set, please specify which statistical indicator you would like to use (supported by hydroGOF)

obs_variable

(optional, string) the observed variable you would like model perfomance to be evaluted with (required if statistic is passed)

depth

(optional, numeric) if your obs_variable has a respective depth, pass it here (cm)

cleanup

(optional, boolean) delete the model files (results) after function completion?

swap_file

(optional, string) SWAP file to run, by default "swap.swp"

n_cores

(optional, numeric) The number of CPU cores to run the sensitivity anaylysis on.

autoset_output

(optional, boolean) Match model output to observed data?

force

(optional, boolean) If an rswap directory already exists, no new one will be generated/reloaded unless force=TRUE. Defaults to TRUE

verbose

(optional, boolean) Print actions to console?

timeout

(optional, numeric) Maximum model runtime in seconds. Unlimited by default.

Value

Prints interactive plot and returns dataframe of the results.

Details

Currently supported output is statistical evalution only. This function is not yet fully finished!

Examples

if(FALSE){
check_swap_sensitivity(
project_path = "C:/Users/mosh/Documents/rswaptesting/tetves/",
variable = "OSAT",
values = seq(0.32, 0.48, by = 0.01),
row = 1,
statistic = "NSE",
obs_variable = "WC",
depth = 15,
cleanup = TRUE,
autoset_output = TRUE,
verbose = TRUE
)}