Usage
folder(
ssimObject = NULL,
folder = NULL,
parentFolder = NULL,
summary = FALSE,
create = FALSE
)
Arguments
- ssimObject
SsimLibrary
orProject
object.- folder
character or integer. If character, then will either open an existing folder if
create=FALSE
, or will create a new folder with the given name if the folder does not exist yet orcreate=TRUE
(Default). If integer, will open the existing folder with the given folder ID (if the ID exists).- parentFolder
character, integer, or SyncroSim Folder object. If not
NULL
(Default), the new folder will be created inside of the specified parent folder- summary
logical. If
FALSE
, then returns a folder object. IfTRUE
, then returns a dataframe of information about the specified folder- create
logical. Whether to create a new folder if the folder name given already exists in the SyncroSim library. If
FALSE
(Default), then will return the existing folder with the given name. IfTRUE
, then will return a new folder with the same name as an existing folder (but different folder ID)
Examples
# \donttest{
# Set the file path and name of the new SsimLibrary
myLibraryName <- file.path(tempdir(),"testlib")
# Set the SyncroSim Session, SsimLibrary, Project, and Scenario
mySession <- session()
myLibrary <- ssimLibrary(name = myLibraryName, session = mySession)
#> Warning: The following package associated with this library is not properly installed: stsim v4.3.5
#> Use installPackage(packages = 'stsim', versions = '4.3.5') to install.
myProject <- project(myLibrary, project = "My Project")
myScenario <- scenario(myProject, scenario = "My Scenario")
# Create a new folder
myFolder <- folder(myProject, folder = "New Folder")
# Create a nested folder within "New Folder"
myNestedFolder <- folder(myProject, folder = "New Nested Folder",
parentFolder = myFolder)
# Retrieve a dataframe of all folders in a project
folder(myProject)
#> FolderId Name ProjectId ParentId Owner IsReadOnly
#> 1 46 New Folder 31 N/A N/A No
#> 2 47 New Nested Folder 31 46 N/A No
#> LastModified
#> 1 2025-03-25 at 4:32 PM
#> 2 2025-03-25 at 4:32 PM
# }