mcode: Write, compile, and load model code

View source: R/mcode.R

mcodeR Documentation

Write, compile, and load model code

Description

This is a convenience function that ultimately calls mread. Model code is written to a file and read back in using mread.

Usage

mcode(model, code, project = getOption("mrgsolve.project", tempdir()), ...)

mcode_cache(
  model,
  code,
  project = getOption("mrgsolve.project", tempdir()),
  ...
)

Arguments

model

model name

code

character string specifying a mrgsolve model

project

project name

...

passed to mread; see that help topic for other arguments that can be set

Details

Note that the arguments are in slightly different order than mread. The default project is tempdir().

See the mread help topic for discussion about caching compilation results with mcode_cache.

See Also

mread, mread_cache

Examples


## Not run:  
code <- '
$CMT DEPOT CENT
$PKMODEL ncmt=1, depot=TRUE
$MAIN
double CL = 1;
double V = 20;
double KA = 1;
'

mod <- mcode("example",code)

## End(Not run)


mrgsolve documentation built on May 17, 2022, 1:05 a.m.

Related to mcode in mrgsolve...