assemble the function above to process multiple dbs
sims_stats_multi( path_sims, pattern = ".db$", DT_observation, tableName = "Report", pattern_trts = "(Ashley|Iversen).+SD\\d{1,2}", pattern_split = "(.+)(SD\\d{1,2})", col_treatment1 = "Experiment", col_treatment2 = "SowingDate", mode = c("Profile", "Layers", "Manual"), keys = c("Experiment", "SimulationID", "SowingDate", "KLR", "RFV", "SKL"), test = FALSE )
| path_sims | The path to all apsimx output |
|---|---|
| pattern | db extension |
| DT_observation | The data.table has aggregated observations and ordered by days |
| tableName | a charater string. The name of the simulation output table in the db |
| pattern_trts | regular expression to extract the treatment names from filename |
| pattern_split | regular expression to split two treatment names |
| col_treatment1 | Default is the "Experiment" |
| col_treatment2 | Default is the "SowingDate" |
| mode | three options:
|
| keys | a character vector to define the keys for grouping. three options to match the mode:
|
| test | Test mode - Subset the top 3 db files in the directory to run a test |
a list