Learn R Programming

sdbuildR (version 2.0.0)

dependencies: Find dependencies

Description

Find which other variables each variable is dependent on.

Usage

dependencies(object, name = NULL, type = NULL, reverse = FALSE)

Value

List, with for each model variable what other variables it depends on, or if reverse = TRUE, which variables depend on it

Arguments

object

Stock-and-flow model, object of class stockflow.

name

Variable names to find dependencies for. Defaults to NULL to include all variables.

type

Variable types to find dependencies for. Must be one or more of 'stock', 'flow', 'constant', 'aux', 'gf', or 'func'. Defaults to NULL to include all types.

reverse

If FALSE, list for each variable X which variables Y it depends on for its equation definition. If TRUE, don't show dependencies but dependents. This reverses the dependencies, such that for each variable X, it lists what other variables Y depend on X.

Examples

Run this code
sfm <- stockflow("SIR")
dependencies(sfm)

Run the code above in your browser using DataLab