parentId: Retrieves the parent Scenario id

Description Usage Arguments Value Examples

Description

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

Usage

1
2
3
4
5
6
7
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# 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. 28, 2021, 1:07 a.m.