mwrite_yaml | R Documentation |
Model code is written to a readable, transport format. This transport format
can be useful for (1) breaking connection to NONMEM modeling outputs that
are imported by $NMXML
or $NMEXT
and (2) saving model updates (e.g.,
an updated parameter list). Models can be read back using mread_yaml()
or
converted to mrgsolve cpp format with yaml_to_cpp()
.
mwrite_yaml(x, file, digits = 8)
x |
a model object. |
file |
output file name; if non-character (e.g., |
digits |
precision to use when writing outputs. |
Parameters and omega and sigma matrices that were imported via $NMXML
or $NMEXT
will be written into the yaml file and the NONMEM import blocks
will be dropped. This allows the user to load a model based on a NONMEM run
without having a connection to that output (e.g., root.xml
or root.ext
).
Given that the connection to the NONMEM modeling outputs is broken when
writing to yaml, any update to the NONMEM run will only be propagated to
the yaml file when mwrite_yaml()
is run again.
The yaml file does not currently have the ability to track
other external dependencies, such as user-defined header files or other
code that might be sourced in by the user when the model is loaded via
mread()
. NONMEM xml and ext files imported by $NMXML
or $NMEXT
are
the only external dependencies that are accounted for in the yaml
transport file.
A list containing data that was written out to the yaml file, with added
item file
, is returned invisibly.
mread_yaml()
, yaml_to_cpp()
mod <- house()
temp1 <- tempfile(fileext = ".yaml")
x <- mwrite_yaml(mod, temp1)
readLines(temp1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.