View source: R/data_handling.R
collate_yr | R Documentation |
collate_yr
collates all the .yr output from Vortex matching the
project and scenario name into one R object and calculates the mean for each
simulated year across all iterations.
collate_yr( project, scenario, npops_noMeta = 1, dec_sep = ".", dir_in = NULL, save2disk = TRUE, dir_out = "ProcessedData", verbose = TRUE )
project |
The Vortex project name to be imported |
scenario |
The scenario name, default: NULL |
npops_noMeta |
The total number of populations excluding the metapopulation, default: 1 |
dec_sep |
Decimal separator (default ".") |
dir_in |
The local folder containing Vortex files, default: NULL. If not specified, will fall back to use current working directory. |
save2disk |
Whether to save the data as rda and csv, default: TRUE |
dir_out |
The local path to store the output. Default: ProcessedData |
verbose |
Progress messages, default: TRUE |
dir_in
may contain other files; only files matching the project and
the scenario name will be read.
dir_out
is created within the working directory unless a full path is
provided.
If no matching files are found in the given directory, an error is reported.
When verbose=TRUE
the progress (i.e. the file being read) is reported
on screen.
a list with two elements: 'census', a data.frame with data from all Vortex files and 'census_means', a data.table with the mean of each parameter across all iterations for each simulated year
# Using Pacioni et al. example files. See ?pacioni for more details. pac.dir <- system.file('extdata', 'pacioni', package='vortexRdata') # Run collate_yr on all .yr of project 'Pacioni_et_al' and the ST scenario # 'ST_Classic' in the selected folder and store the result in 'yr.st.classic' yr.st.classic <- collate_yr(project='Pacioni_et_al', scenario='ST_Classic', dir_in = pac.dir, save2disk=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.