add_mixed_param: Add a mixed effect parameter to $PK (or $PRED)

View source: R/param-manipulate.R

add_mixed_paramR Documentation

Add a mixed effect parameter to $PK (or $PRED)

Description

[Stable]

Primarily an internal function. This will (by default) add a parameter (mixed effect) to your code $PK/$PRED and $THETA/$OMEGA.

Usage

add_mixed_param(
  m,
  name,
  init = 1,
  unit = "",
  trans = c("LOG"),
  position = NA_integer_,
  after = character()
)

Arguments

m

An nm object.

name

Character. Name of NONMEM variable to create.

init

Numeric (default = 1). Initial value of fixed effect.

unit

Character (default = ""). Unit of variable.

trans

Character (default = "LOG"). Transformation of the variable.

position

Integer. Not used.

after

Character. Pattern to match and include the mixed effect after.

Value

An nm object with modified ctl_contents field.

Examples


# create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1", 
             based_on = file.path(exdir, "Models", "ADVAN2.mod"),
             data_path = file.path(exdir, "SourceData", "THEOPP.csv"))

m1 %>% dollar("PK")
m1 %>% dollar("THETA")

m1 <- m1 %>% add_mixed_param("ALAG1", init = 1.1, unit = "h", trans = "LOG")

m1 %>% dollar("PK")
m1 %>% dollar("THETA")


NMproject documentation built on Sept. 30, 2022, 1:06 a.m.