R/Framework.R
Projects.RdCreate a StoX project using createProject; open an existing (un-opened) project using openProject, which involves creating files holding the memory of the project; close a project using closeProject, which removes the memory files; save the project using saveProject, which saves the memory files to the project description file; make a copy using copyProject or saveAsProject, where the former closes the given project unsaved and opens the copy, or delete a project using deleteProject.
createProject(
projectPath,
template = "EmptyTemplate",
ow = FALSE,
showWarnings = FALSE,
open = TRUE,
Application = R.version.string
)
openProject(
projectPath,
showWarnings = FALSE,
force = FALSE,
reset = FALSE,
saveIfAlreadyOpen = FALSE,
verbose = FALSE
)
openProjectAsTemplate(
projectPath,
newProjectPath,
close = FALSE,
save = NULL,
ow = FALSE
)
closeProject(
projectPath,
save = NULL,
force.save = FALSE,
Application = R.version.string,
msg = TRUE
)
saveProject(
projectPath,
force = FALSE,
Application = R.version.string,
msg = TRUE
)
saveAsProject(
projectPath,
newProjectPath,
ow = FALSE,
Application = R.version.string
)
copyProject(
projectPath,
newProjectPath,
ow = FALSE,
empty.output = FALSE,
empty.input = FALSE,
empty.memory = FALSE,
clean.process = TRUE,
empty.processData = FALSE,
processDataToBeEmptied = NULL,
close = FALSE,
save = NULL,
msg = TRUE
)
deleteProject(projectPath)
getProject(projectPath)The path to the StoX project, i.e., the folder of the project with the sub folders "input", "output" and "process". Can possibly be the path to a file inside the project folder.
A string naming the template to use when generating the project. See getAvaiableTemplates for a list of available templates.
Logical: If TRUE overwrite the project.
Logical: If TRUE display warninigs when creting the project folders.
Logical: If TRUE open the project after creating it.
A single string naming the application used when saving the project. Defaulted to R.version.string.
Logical: If TRUE reopen (close and then open) the project if already open.
Logical: If TRUE reset each model to the start of the model.
Logical: If TRUE save the project before closing if already open and force is TRUE.
Logical: If TRUE, print information to the console, e.g. about backward compatibility.
The path to the copied StoX project.
Logical: (In copyProject) If TRUE, close the project before copying.
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 FALSE no messages are printed to console (except possibly for extremely important ones).
Logical: If TRUE, delete all files in the output folder when copying. If FALSE, all files in the output folder are copied. If NA, only outputs from processes which have the enabled and fileOutput arguent set to TRUE (Enabled and Write output to file in the StoX GUI) are copied to the new project. This can also be a vector of names of the specific output files/folders to empty (relative file paths, e.g. "baseline/ReadBiotic").
Logical: If TRUE, delete all files in the input folder when copying. If FALSE, all files in the input folder are copied. If NA, keep all usaed input files (in the sub folders of the input folder (acoustic, biotic and landing)), and keep any files in the root input folder (the input folder is frequently used to place stratum files etc, and there are kept while input files are deleted with this option). This can also be a vector of names of the specific input files/folders to empty (relative file paths, e.g. "biotic").
Logical: Only used if close is FALSE. If TRUE, do not include the memory data files when copying. This can also be a vector of names of the specific memory files/folders to empty (file paths relative to the memory folder "projectSession/data/models", e.g. c("analysis", "report") to keep only the baseline memory).
Logical: If TRUE copy only the project.json file in the process folder and ignore any other files (e.g. copies of the project.json file).
Logical: (In copyProject) If TRUE, empty the process data listed in processDataToBeEmptied.
An optional character vector of names of the process data to empty when copying a StoX project. The default (NULL) implies all possible process data (all functions returned from getRstoxFrameworkDefinitions("processDataFunctions")).
Hidden files are not copied with copyProject. To copy the project with all non-hidden files included use clean.process = FALSE (in addition to the defaults empty.output = FALSE, empty.input = FALSE, empty.memory = FALSE).