Learn R Programming

mrgsolve (version 1.5.1)

init: Methods for working with the model compartment list

Description

Calling init with the model object as the first argument will return the model initial conditions as a numericlist object. See numericlist for methods to deal with cmt_list objects.

Usage

init(.x, ...)

# S4 method for mrgmod init(.x, .y = list(), ..., .pat = "*")

# S4 method for mrgsims init(.x, ...)

# S4 method for missing init(.x, ...)

# S4 method for list init(.x, ...)

# S4 method for ANY init(.x, ...)

Value

an object of class cmt_list (see numericlist)

Arguments

.x

the model object

...

passed along

.y

list to be merged into parameter list

.pat

a regular expression (character) to be applied as a filter when printing compartments to the screen

Details

Can be used to either get a compartment list object from a mrgmod model object or to update the compartment initial conditions in a model object. For both uses, the return value is a cmt_list object. For the former use, init is usually called to print the compartment initial conditions to the screen, but the cmt_list object can also be coerced to a list or numeric R object.

Examples

Run this code
## example("init")
mod <- mrgsolve::house()

init(mod)
init(mod, .pat="^C") ## may be useful for large models

class(init(mod))

init(mod)$CENT

as.list(init(mod))
as.data.frame(init(mod))

Run the code above in your browser using DataLab