parentId: Retrieves the parent Scenario id

parentIdR Documentation

Retrieves the parent Scenario id

Description

Retrieves the id of the parent of a SyncroSim results Scenario.

Usage

parentId(scenario)

## S4 method for signature 'character'
parentId(scenario)

## S4 method for signature 'Scenario'
parentId(scenario)

Arguments

scenario

Scenario object

Value

An integer id of the parent Scenario. If the input Scenario does not have a parent, the function returns NA

Examples


# Install helloworldSpatial SyncroSim package
addPackage("helloworldSpatial")

# Set the file path and name of the new SsimLibrary
myLibraryName <- file.path(tempdir(),"testlib_parentId")

# Set the SyncroSim Session, SsimLibrary, Project, and Scenario
mySession <- session()
myLibrary <- ssimLibrary(name = myLibraryName,
                         session = mySession,
                         package = "helloworldSpatial",
                         template = "example-library")
myProject <- project(myLibrary, project = "Definitions")
myScenario <- scenario(myProject, scenario = "My Scenario")

# Run Scenario to generate results
resultScenario <- run(myScenario)

# Find the parent ID of the Scenario
parentId(resultScenario)



rsyncrosim documentation built on Oct. 8, 2022, 9:06 a.m.