Skip to contents

This function creates a data frame of scenarios by combining scenarios groups, climate scenarios and soil scenarios.

Usage

create_running_scenarios(
  verbose = TRUE,
  scenarios_groups = get_scenarios_groups(..., cfg = cfg),
  climate_scenarios = get_xxx_scenarios(category = "climate", ..., cfg = cfg),
  soil_scenarios = get_xxx_scenarios(category = "soil", ..., cfg = cfg),
  write_results = cfg$data$write_results,
  timestamp = format(Sys.time(), "%Y%m%d_%H%M%S"),
  path = file.path(path.expand("~"),
    ".cache/OptirrigPTGE/Inputs/Scenarios/Running_scenarios", sprintf("%s.csv",
    timestamp)),
  return_scenarios = TRUE,
  ...,
  cfg = loadConfig()
)

Arguments

verbose

logical Whether to print logs to the console.

scenarios_groups

data.frame Scenarios groups data frame. See load_scenarios_groups() for more details.

climate_scenarios

data.frame Climate scenarios data frame. See get_xxx_scenarios(category = "climate") for more details.

soil_scenarios

data.frame Soil scenarios data frame. See get_xxx_scenarios(category = "soil") for more details.

write_results

logical If TRUE writes the results in the data folder. See returned value of loadConfig.

timestamp

character Timestamp used to build the default output path.

path

character Path to save the scenarios data frame as a CSV file.

return_scenarios

logical If TRUE, the function returns the scenarios data frame. If FALSE, the function returns NULL.

...

Additional arguments

cfg

a config object. Configuration to use. See loadConfig for details

Value

data.frame Scenarios data frame if return_scenarios is TRUE, otherwise NULL.