Skip to contents

Delete Project, Scenario, Folder, Chart or Datasheet

Usage

delete(
  ssimObject,
  project = NULL,
  scenario = NULL,
  folder = NULL,
  chart = NULL,
  datasheet = NULL,
  force = FALSE,
  session = NULL
)

# S4 method for class 'SsimObject'
delete(
  ssimObject,
  project = NULL,
  scenario = NULL,
  folder = NULL,
  chart = NULL,
  datasheet = NULL,
  force = FALSE,
  session = NULL
)

Arguments

ssimObject

SsimLibrary, Project, Scenario, Folder, or Chart object

project

character string, numeric, or vector of these. One or more Project names or ids. Note that project argument is ignored if ssimObject is a list. Note that integer ids are slightly faster (optional)

scenario

character string, numeric, or vector of these. One or more Scenario names or ids. Note that scenario argument is ignored if ssimObject is a list. Note that integer ids are slightly faster (optional)

folder

character string, numeric, or vector of these. One or more Folder names or ids. Note that folder argument is ignored if ssimObject is a list. Note that integer ids are slightly faster (optional)

chart

character string, numeric, or vector of these. One or more Chart names or ids. Note that chart argument is ignored if SsimObject is a list. Note that integer ids are slightly faster (optional)

datasheet

character string or vector of these. One or more datasheet names (optional)

force

logical. If FALSE (default), user will be prompted to approve removal of each item

session

Session object. If NULL (default), session() will be used. Only applicable when ssimObject argument is a character

Value

Invisibly returns a list of boolean values corresponding to each input: TRUE upon success (i.e.successful deletion) and FALSE upon failure.

Details

Deletes one or more items. Note that this is irreversible. To delete a library, you must use the deleteLibrary function instead.

Examples

# \donttest{
# Specify file path and name of new SsimLibrary
myLibraryName <- file.path(tempdir(), "testlib")

# Set up a SyncroSim Session, SsimLibrary, and Project
mySession <- session()
#> Error in .local(.Object, ...): SyncroSim v3.0.22 is required to run rsyncrosim v2.0.2 but you have SyncroSim v3.0.21 installed.
myLibrary <- ssimLibrary(name = myLibraryName, session = mySession)
#> Error in eval(expr, envir, enclos): object 'mySession' not found
myProject <- project(myLibrary, project = "a project")
#> Error in eval(expr, envir, enclos): object 'myLibrary' not found

# Check the Projects associated with this SsimLibrary
project(myLibrary)
#> Error in eval(expr, envir, enclos): object 'myLibrary' not found

# Delete Project
delete(myLibrary, project = "a project", force = TRUE)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'ssimObject' in selecting a method for function 'delete': object 'myLibrary' not found

# Check that Project was successfully deleted from SsimLibrary
project(myLibrary)
#> Error in eval(expr, envir, enclos): object 'myLibrary' not found
# }