Load simulation outputs into the dynasimR standard format
Source:R/read_simulation.R
read_simulation.RdReads CSV outputs from any discrete-event or agent-based
simulation framework that follows the dynasimR file-naming
convention and validates them against the dynasimR data schema.
Returns a structured S3 object of class dynasimR_data.
Arguments
- data_dir
Character. Path to the directory containing simulation outputs. Files are expected to follow the pattern
{scenario_id}_summary.csv,{scenario_id}_entities.csvand (optionally){scenario_id}_timeseries.csv.- scenarios
Character vector. Scenario IDs to load. Default
NULLloads every scenario found indata_dir.- validate
Logical. Run
validate_dynasimR_data()on the loaded tables. DefaultTRUE.- verbose
Logical. Print progress messages. Default
TRUE.
Value
An S3 object of class dynasimR_data (a list) with slots
summary, entities, timeseries, metadata and load_info.
Examples
if (FALSE) { # \dontrun{
sim <- read_simulation("data/raw/")
sim <- read_simulation("data/raw/",
scenarios = c("A-S00", "A-S07", "A-S08"))
sim <- read_simulation(system.file("extdata", package = "dynasimR"))
} # }