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

Description Usage Arguments Value Examples

View source: R/param-manipulate.R

Description

[Stable]

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

Usage

1
2
3
4
5
6
7
8
9
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 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 Oct. 18, 2021, 1:08 a.m.