Learn R Programming

nlmixr2lib

This is a model library for nlmixr2. The package allows a few ways to interact with the model library:

# See all available models
modellib()
# Load the "PK_1cmt" model
modellib(name="PK_1cmt")
# Switch residual error to additive
modellib(name="PK_1cmt", reserr = "addSd")
# Add inter-individual variability on ka and v and switch residual error to
# additive and proportional
modellib(name="PK_1cmt", eta = c("lka", "lv"), reserr = c("addSd", "propSd"))

Modifying models by piping

You may also modify any model from the library (or your own models) with a piping interface. The code below adds inter-individual variability on ka and v and then switches residual error to additive and proportional.

modellib(name="PK_1cmt") %>%
  addEta(c("lka", "lv") %>%
  addResErr(c("addSd", "propSd"))

Possible extensions

The modellib function is set-up in way that it can be easily extended and used in other applications. A possible extension could be implementation in a shiny app. An app can be created to easily add new models to the model library database (curated?), and directly make these models available for other users. I believe there can be added value in having a base model library that can be easily extended by the community this way.

Copy Link

Version

Install

install.packages('nlmixr2lib')

Monthly Downloads

261

Version

0.3.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Bill Denney

Last Published

October 7th, 2024

Functions in nlmixr2lib (0.3.0)

addIndirect

Add an indirect response model to a PK model
modellib

Get the model from the model library
convertQuad

Convert linear elimination to quadratic elimination
readModelDb

Read a model from the nlmixr2 model database
reexports

Objects exported from other packages
removeDepot

To convert from first order oral absorption to IV/Intravenous
pkTrans

Change the transformation type for PK models
fakeCc

Fake blank Cc for creating PD only models
convertMM

Convert models from linear elimination to Michaelis-Menten elimination
updateOncologyXenograftSimeoni2004

Update an oncology xenograft model based on Simeoni 2004
setCombineType

Change the default combine type for the package
convertLogLin

Converts a linear effect to a log-linear effect
defaultCombine

Default combine strings
modeldb

Model library for nlmixr2
searchReplace

Search within a model to replace part of the model
removeLinesAndInis

Removes lines and inis from a model
removeTransit

To remove transit compartments from the model
addEffectCmtLin

Add effect compartment
addDirToModelDb

Add a directory to the modeldb
addCmtProp

Add a property to a compartment
addBaseline1exp

Add baseline that decays exponential with time
addBaselineLin

Add an estimated baseline linear constant
addDepot

To convert from infusion/intravenous administration to first-order oral absorption
addBaselineExp

Add baseline that decays exponential with time
addEta

Add random effects to a model
addDirectLin

Add direct linear effect with baseline=0
addBaselineConst

Add an estimated baseline constant
combinePaste2

Combine two strings using a naming convention
addTransit

To add transit compartments to the model
convertEmax

Convert linear effect to Emax effect
addLogEstimates

Add log estimates to a model
addWeibullAbs

Converts first order absorption model to Weibull absorption model
convertKinR0

Convert a kin/kout indirect response model to R0 and kout
addIndirectLin

Add linear indirect response model
convertEmaxHill

Convert linear effect to Emax-Hill effect
addResErr

Add residual error to a model