This function runs and returns output from all models of a StoX project.
runProjects(
projectPaths,
modelNames = getRstoxFrameworkDefinitions("stoxModelNames"),
processes = NULL,
startProcess = 1,
endProcess = Inf,
drop.datatype = TRUE,
unlistDepth2 = FALSE,
run = TRUE,
save = FALSE,
force.save = FALSE,
force.restart = FALSE,
replaceDataList = list(),
replaceArgsList = list(),
prependProcessList = list(),
fileOutput = NULL,
setUseProcessDataToTRUE = TRUE,
purge.processData = FALSE,
returnModelData = TRUE,
returnBootstrapData = FALSE,
selection = list(),
BootstrapID = NA,
unlistSingleTable = FALSE,
try = TRUE,
unlist.models = FALSE,
close = FALSE,
...
)
A vector of paths to the StoX projects.
The name of the models (possible values are "baseline", "analysis" and "report").
The name of the processes.
The process index, name or ID at which to start the model run. A list can be given named by the models if one needs to specify start process for each model. Models given inn modelNames
but not in the list will be run from the start of the model.
The process index, name or ID at which to stop the model run. A list can be given named by the models if one needs to specify end process for each model. Models given inn modelNames
but not in the list will be run to the end of the model.
Logical: If TRUE, drop the top level of the output list if it has length 1 and that single element is named by the datatype name.
Logical: Related to drop.datatype
, but setting this to TRUE unlists output data that are nested in 2 levels, such as output from ReadBiotic
, which outputs a set of tables for each input file. Using unlistDepth2 = TRUE puts all these tables in one list, and uses the concatenation of the file names and the table name separated by underscore. This is how it is displayed in the StoX GUI when selecting "View output".
Logical: If TRUE run the model.
Logical: If TRUE save the project before closing. Default (NULL) is to ask the user whether to save the project before closing.
If no changes are made to the project, force save anyway. Overrides the save
option.
Logical: If TRUE, start the processes even if the status file indicating that the model is being run exists. This is useuful when something crached in a preivous run, in which case the model is still appearing as running.
A list named by the processes to replace output data for. See runProcess
.
A list of replaceArgs
(see runProcess
) holding parameters to replace in the function call, named by the processes to modify.
A list of values
used in prependProcess
, named by the processes to prepend a process to.
Logical: If TRUE save the output as a text file (or other format specified by the class or attributes of the output). If NULL (defafult) use the corresponding parameter of the process.
Logical: If TRUE set the UseProcessData function parameter to TRUE in the process memory after execution, if the process is a ProcessData process.
Logical: If TRUE replace process data entirely.
Logical: If TRUE return the output of the model runs. Can also be given as a string vector holding the names of the models to return data from. If TRUE, the specific models to return data from (across models) can be given by processes
.
Logical: If TRUE read the content of bootstrap NetCDF4 file.
Hierarchical list of names of the groups/variables. The last element must be a vector of the variables to return from the table specified by the other elements. E.g., list("ImputeSuperIndividuals", "SuperIndividualsData", c("Stratum", "IndividualAge", "Abundance")) will return a data.table of the three columns "Stratum", "IndividualAge" and "Abundance", added the BootstrapID specified in BootstrapID
.
A sequence of bootstrap IDs, i.e., the indices of the bootstrap replicates. The default returns all bootstrap replicates.
Logical: For use when only single table process outputs are among the requested processes in OutputProcesses
of Bootstrap
. If FALSE (default) return a list named by the selection
with a sub-list named by the datatype holding the output data (e.g. $ImputeSuperIndividuals$SuperIndividualsData). If TRUE return a list named by the selection
holding the output data, replicating the output of Bootstrap
in StoX <= 3.6.2.
Logical: If FALSE do not run the process in a tryCatch
. Set this to FALSE when debugging, as the tryCatch
masks the errors in the traceback
.
Logical: If TRUE unlist the top level so that all processes are in one list.
Logical: (In copyProject
) If TRUE, close the project before copying.
replaceArgsList
can also be given directly.
A list of model output.