List dependencies, set dependencies, or remove dependencies from a SyncroSim
Scenario. Setting dependencies is a way of linking together
Scenario Datafeeds, such that a change in the Scenario that is the source
dependency will update the dependent Scenario as well.
dependency(scenario, dependency = NULL, remove = FALSE, force = FALSE) ## S4 method for signature 'character' dependency(scenario, dependency = NULL, remove = FALSE, force = FALSE) ## S4 method for signature 'Scenario' dependency(scenario, dependency = NULL, remove = FALSE, force = FALSE)
dependency==NULL, other arguments are ignored, and set of existing dependencies
is returned in order of precedence (from highest to lowest precedence).
Otherwise, returns list of saved or error messages for each dependency of each
Note that the order of dependencies can be important - dependencies added most recently take precedence over existing dependencies. So, dependencies included in the dependency argument take precedence over any other existing dependencies. If the dependency argument includes more than one element, elements are ordered from lowest to highest precedence.
If dependency is
NULL, a data frame of existing dependencies, or list of these
if multiple inputs are provided. If dependency is not
NULL, the function
invisibly returns a list bearing the names of the dependencies inputted and
carrying a logical
TRUE upon success (i.e.successful addition or deletion)
FALSE upon failure
# Specify file path and name of new SsimLibrary myLibraryName <- file.path(tempdir(), "testlib") # Set up a SyncroSim Session, SsimLibrary, Project, and 2 Scenarios mySession <- session() myLibrary <- ssimLibrary(name = myLibraryName, session = mySession) myProject <- project(myLibrary, project = "Definitions") myScenario <- scenario(myProject, scenario = "My Scenario") myNewScenario <- scenario(myProject, scenario = "my New Scenario") # Set myScenario as a dependency of myNewScenario dependency(myNewScenario, dependency = myScenario) # Get all dependencies info dependency(myNewScenario) # Remove dependency dependency(myNewScenario, dependency = myScenario, remove = TRUE) # Force removal of dependency dependency(myNewScenario, dependency = myScenario, remove = TRUE, force = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.