Learn R Programming

mrgsolve (version 1.5.1)

mwrite_cpp: 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)

Value

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

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().

See Also

mwrite_yaml(), yaml_to_cpp()

Examples

Run this code
temp <- tempfile(fileext = ".mod")

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

x <- mwrite_cpp(mod, file = temp)

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

mod

Run the code above in your browser using DataLab