% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/import_insightmaker.R
\name{import_insightmaker}
\alias{import_insightmaker}
\title{Import Insight Maker model}
\usage{
import_insightmaker(
  url,
  file,
  keep_nonnegative_flow = TRUE,
  keep_nonnegative_stock = FALSE
)
}
\arguments{
\item{url}{URL to Insight Maker model. Character.}

\item{file}{File path to Insight Maker model. Only used if url is not specified. Needs to be a character with suffix .InsightMaker or .json.}

\item{keep_nonnegative_flow}{If TRUE, keeps original non-negativity setting of flows. Defaults to TRUE.}

\item{keep_nonnegative_stock}{If TRUE, keeps original non-negativity setting of stocks. Defaults to FALSE.}
}
\value{
A stock-and-flow model object of class \code{\link{stockflow}}.
}
\description{
Import a stock-and-flow model from \href{https://insightmaker.com/}{Insight Maker}. Models may be your own or another user's. Importing causal loop diagrams or agent-based models is not supported.
}
\details{
Insight Maker models can be imported using a URL, Insight Maker file, or ModelJSON 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" or "ModelJSON File".
}
\examples{
\dontshow{if (has_internet() && Sys.getenv("NOT_CRAN") == "true") withAutoprint(\{ # examplesIf}
# Load a model from Insight Maker
sfm <- import_insightmaker(
  url =
    "https://insightmaker.com/insight/43tz1nvUgbIiIOGSGtzIzj/Romeo-Juliet"
)
plot(sfm)

\dontshow{
sfm <- sim_settings(sfm, save_by = .5)
}

# Simulate the model
sim <- simulate(sfm)
plot(sim)
\dontshow{\}) # examplesIf}
}
\seealso{
\code{\link[=update]{update()}}, \code{\link[=stockflow]{stockflow()}}
}
\concept{importExport}
