mwrite_cpp {mrgsolve}R Documentation

Write a model to native mrgsolve format

Description

Model code is written to a file in native mrgsolve format. This 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().

Usage

mwrite_cpp(x, file, update = TRUE)

Arguments

x

a model object.

file

output file name; if non-character (e.g., NULL), no output will be written to file.

update

TRUE if model settings should be written into the cpp file in a ⁠$SET⁠ block.

Details

See important details in mwrite_yaml().

Value

A list containing data that was written out to the cpp file, with added item file, is returned invisibly.

See Also

mwrite_yaml(), yaml_to_cpp()

Examples

temp <- tempfile(fileext = ".mod")

mod <- modlib("pk1", compile = FALSE)

x <- mwrite_cpp(mod, file = temp)

mod <- mread(x$file, compile = FALSE)

mod


[Package mrgsolve version 1.5.1 Index]