A model library for nlmixr2. The models include (and plan to include) pharmacokinetic, pharmacodynamic, and disease models used in pharmacometrics. Where applicable, references for each model are incl
HealthR · Visual Basic 6.0GitHub @nlmixr2OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
A model library for nlmixr2. The models include (and plan to include) pharmacokinetic, pharmacodynamic, and disease models used in pharmacometrics. Where applicable, references for each model are included in the meta-data for each individual model. The package also includes model composition and modification functions to make model updates easier.
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
This is a model library for nlmixr2. The package allows a few ways to interact with the model library:
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.Read the full README ↗Which version are you on?
This site documents the development version. The articles here cover every model in the development library; the CRAN release contains far fewer, so a
readModelDb()call copied from an article will fail with'name' not in databaseif you are on CRAN.
models CRAN 0.3.2(released 2026-01-18)59 development 0.3.2.90002912 To get the models these articles describe:
install.packages( "nlmixr2lib", repos = c("https://nlmixr2.r-universe.dev", getOption("repos")) )Then restart R.
readModelDb()andmodeldbboth resolve against the package as loaded, so a reinstall in a running session leaves the old model list in memory and the new models will still appear missing.Check it worked:
packageVersion("nlmixr2lib") # 0.3.2.9000 nrow(nlmixr2lib::modeldb) # 2912The r-universe repository is needed rather than plain
install_github(): the development version requiresrxode2 (>= 5.1.8), which is not on CRAN yet, and r-universe serves prebuilt binaries so no compiler is required.
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"))
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"))
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.