| as.data.frame.sdbuildR_xmile | R Documentation |
Create a data frame with properties of all model variables, model units, and macros. Specify the variable types, variable names, and/or properties to get a subset of the data frame.
## S3 method for class 'sdbuildR_xmile'
as.data.frame(
x,
row.names = NULL,
optional = FALSE,
type = NULL,
name = NULL,
properties = NULL,
...
)
x |
A stock-and-flow model object of class |
row.names |
NULL or a character vector giving the row names for the data frame. Missing values are not allowed. |
optional |
Ignored parameter. |
type |
Variable types to retain in the data frame. Must be one or more of 'stock', 'flow', 'constant', 'aux', 'gf', 'macro', or 'model_units'. Defaults to NULL to include all types. |
name |
Variable names to retain in the data frame. Defaults to NULL to include all variables. |
properties |
Variable properties to retain in the data frame. Defaults to NULL to include all properties. |
... |
Optional arguments |
A data.frame with one row per model component (variable, unit definition, or macro).
Common columns include type (component type), name (variable name),
eqn (equation), units (units of measurement), and label
(descriptive label). Additional columns may include to, from,
non_negative, and others depending on variable types. The exact columns returned
depend on the type and properties arguments. Returns an empty data.frame
if no components match the filters.
as.data.frame(xmile("SIR"))
# Only show stocks
as.data.frame(xmile("SIR"), type = "stock")
# Only show equation and label
as.data.frame(xmile("SIR"), properties = c("eqn", "label"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.