saveScenarioResults: Save results of scenario simulations to csv.

View source: R/utilities-scenarios.R

saveScenarioResultsR Documentation

Save results of scenario simulations to csv.

Description

Save results of scenario simulations to csv.

Usage

saveScenarioResults(
  simulatedScenariosResults,
  projectConfiguration,
  outputFolder = NULL,
  saveSimulationsToPKML = TRUE
)

Arguments

simulatedScenariosResults

Named list with simulation, results, outputValues, and population as produced by runScenarios().

projectConfiguration

An instance of ProjectConfiguration

outputFolder

Optional - path to the folder where the results will be stored. If NULL (default), a sub-folder in ⁠ProjectConfiguration$outputFolder/SimulationResults/<DateSuffix>⁠.

saveSimulationsToPKML

If TRUE (default), simulations corresponding to the results are saved to PKML along with the results.

Details

For each scenario, a separate csv file will be created. If the scenario is a population simulation, a population is stored along with the results with the file name suffix ⁠_population⁠. Results can be read with the loadScenarioResults() function.

Value

outputFolder or the created output folder path, if no outputFolder was provided.

Examples

## Not run: 
projectConfiguration <- esqlabsR::createProjectConfiguration()
scenarioConfigurations <- readScenarioConfigurationFromExcel(
  projectConfiguration = projectConfiguration
)
scenarios <- createScenarios(scenarioConfigurations = scenarioConfigurations)
simulatedScenariosResults <- runScenarios(
  scenarios = scenarios
)
saveScenarioResults(simulatedScenariosResults, projectConfiguration)

## End(Not run)

esqLABS/esqlabsR documentation built on April 17, 2025, 10:51 a.m.