mread_yaml | R Documentation |
Read back models written to file using mwrite_yaml()
. Function
yaml_to_cpp()
is also provided to convert the yaml file to mrgsolve cpp
file format.
mread_yaml(
file,
model = basename(file),
project = tempdir(),
update = FALSE,
...
)
yaml_to_cpp(file, model = basename(file), project = getwd(), update = TRUE)
file |
the yaml file name. |
model |
a new model name to use when calling |
project |
the directory where the model should be built. |
update |
|
... |
passed to |
Note that yaml_to_cpp()
by default writes model settings into the cpp
file. mread_yaml()
does not write model settings into the file but rather
update the model object directly with data read back from the yaml
file.
A model object.
mwrite_yaml()
mod <- house()
temp <- tempfile(fileext = ".yaml")
mwrite_yaml(mod, file = temp)
# Note: this model is not compiled
mod <- mread_yaml(temp, model = "new-house", compile = FALSE)
mod
cppfile <- yaml_to_cpp(temp, project = tempdir())
readLines(cppfile)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.