Deletes one or more items. Note that this is irreversible.

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

# S4 method for character
delete(
  ssimObject,
  project = NULL,
  scenario = NULL,
  datasheet = NULL,
  force = FALSE
)

# S4 method for SsimObject
delete(
  ssimObject,
  project = NULL,
  scenario = NULL,
  datasheet = NULL,
  force = FALSE
)

Arguments

ssimObject

SsimLibrary, Project, or Scenario object, or character (i.e. path to a SsimLibrary)

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)

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

Value

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

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()
myLibrary <- ssimLibrary(name = myLibraryName, session = mySession)
myProject <- project(myLibrary, project = "a project")

# Check the Projects associated with this SsimLibrary
project(myLibrary)
#>   ProjectID      Name Owner      DateLastModified IsReadOnly
#> 1         1 a project   N/A 2024-02-01 at 3:34 PM         No

# Delete Project
delete(myLibrary, project = "a project", force = TRUE)
#> Project 1 deleted

# Check that Project was successfully deleted from SsimLibrary
project(myLibrary)
#> [1] ProjectID        Name             Owner            DateLastModified
#> [5] IsReadOnly      
#> <0 rows> (or 0-length row.names)
# }