View source: R/insightmaker_to_sfm.R
| insightmaker_to_sfm | R Documentation |
Import a stock-and-flow model from Insight Maker. Models may be your own or another user's. Importing causal loop diagrams or agent-based models is not supported.
insightmaker_to_sfm(
URL,
file,
keep_nonnegative_flow = TRUE,
keep_nonnegative_stock = FALSE,
keep_solver = FALSE
)
URL |
URL to Insight Maker model. Character. |
file |
File path to Insight Maker model. Only used if URL is not specified. Needs to be a character with suffix .InsightMaker. |
keep_nonnegative_flow |
If TRUE, keeps original non-negativity setting of flows. Defaults to TRUE. |
keep_nonnegative_stock |
If TRUE, keeps original non-negativity setting of stocks Defaults to FALSE. |
keep_solver |
If TRUE, keep the ODE solver as it is. If FALSE, switch to Euler integration in case of non-negative stocks to reproduce the Insight Maker data exactly. Defaults to FALSE. |
Insight Maker models can be imported using either a URL or an Insight Maker file. Ensure the URL refers to a public (not private) model. To download a model file from Insight Maker, first clone the model if it is not your own. Then, go to "Share" (top right), "Export", and "Download Insight Maker file".
A stock-and-flow model object of class sdbuildR_xmile
build(), xmile()
# Load a model from Insight Maker
sfm <- insightmaker_to_sfm(
URL =
"https://insightmaker.com/insight/43tz1nvUgbIiIOGSGtzIzj/Romeo-Juliet"
)
plot(sfm)
# Simulate the model
sim <- simulate(sfm)
plot(sim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.