Learn R Programming

ruminate (version 0.3.1)

mk_rx_obj: Makes an rxode2 Object

Description

Creates an rxode2 object from a model (either rxode2 function or a NONMEM file)

Usage

mk_rx_obj(type, model)

Value

Results of FM_tc() when running the model. This will include a field isgood which is a boolean variable indicating success or failure. See the documentation for FM_tc() for the format returned when evaluation results in a failure and how to address those. When successful the capture field will contain the following:

  • fcn_obj: The function name.

  • rx_obj: The built rxode2 object.

Arguments

type

Type of supplied model can be "rxode2", "NONMEM"

model

List containing the relevant information about the model. This will depend on the model types.

  • rxode2: The supplied model is in the rxode2 format.

    • fcn_def: Character string containing function definition.

    • fcn_obj: Name of the funciton object created in fcn_def.

  • NONMEM: The supplied model is in NONMEM format (either a control

    • model_file: Character string containing the NONMEM model file.

Examples

Run this code
fcn_def = ' my_func = function ()
   {
       description <- "One compartment PK model with linear clearance"
       ini({
           lka <- 0.45
           label("Absorption rate (Ka)")
           lcl <- 1
           label("Clearance (CL)")
           lvc <- 3.45
           label("Central volume of distribution (V)")
           propSd <- c(0, 0.5)
           label("Proportional residual error (fraction)")
       })
       model({
           ka <- exp(lka)
           cl <- exp(lcl)
           vc <- exp(lvc)
           cp <- linCmt()
           cp ~ prop(propSd)
       })

   }'
fcn_obj = "my_func"
model = list(fcn_def = fcn_def,
             fcn_obj = fcn_obj)


rx_res = mk_rx_obj("rxode2", model)

# function object
rx_res[["capture"]][["fcn_obj"]]

# rxode2 object
rx_res[["capture"]][["rx_obj"]]

Run the code above in your browser using DataLab