Writes the model's structure - sets, mappings, parameters, variables and
equations - in the language-neutral encoding described in ast_schema().
Usage
model_to_json(model, path = NULL, data = c("omit", "inline"), pretty = TRUE)Details
Bulk data payloads are omitted by default: they belong in the Parquet
store that save_model() writes, not in a JSON document. Pass
data = "inline" for a self-contained file, which is practical for small
models.
Examples
m <- example_models$energyRt$multimod
js <- model_to_json(m)
m2 <- model_from_json(js)
