Learn R Programming

babelmixr2

The goal of babelmixr2 is to convert nlmixr2 syntax to other commonly used tools.

Installation

You can install the released version of babelmixr2 from CRAN with:

install.packages("babelmixr2")

You can install from r-universe by:

# Download and install babelmixr2 in R
install.packages('babelmixr2',
                 repos = c(
                   nlmixr2 = 'https://nlmixr2.r-universe.dev',
                   CRAN = 'https://cloud.r-project.org'))

Otherwise you can always install from GitHub:

What you can do with babelmixr2

Babelmixr2 can help you by:

  • Running your nlmixr2 model in a commercial nonlinear mixed effects modeling tool like NONMEM or Monolix

  • Convert your NONMEM model to a nlmixr2 model (in conjunction with nonmem2rx)

  • Convert you Monolix model to a nlmixr2 model (in conjunction with monolix2rx)

  • Calculate scaling factors and automatically add initial conditions based on non-compartmental analysis (using PKNCA)

  • Perform Optimal design using nlmixr2 as an interface to PopED

Monolix Setup

While not required, you can get/install the R ‘lixoftConnectors’ package in the ‘Monolix’ installation, as described at the following url https://monolixsuite.slp-software.com/r-functions/2024R1/installation-and-initialization. When ‘lixoftConnectors’ is available, R can run ‘Monolix’ directly instead of using a command line.

PKNCA Example

After installed, if you use the standard interface, you can obtain new initial estimates with PKNCA:

mod <-
  nlmixr2(
    nlmixrFun, nlmmixrData, est = "pknca",
    control = pkncaControl(concu = "ng/mL", doseu = "mg", timeu = "hr", volumeu = "L")
  )

Monolix example

With babelmixr2 loaded, you can use nlmixr2 to convert a nlmixr2 model to Monolix, run with monolix, and import back to nlmixr2 with the following:

mod <- nlmixr(nlmixrFun, nlmmixrData, est="monolix")

NONMEM example

With babelmixr2 loaded you can use nlmixr2 to convert a nlmixr2 model to NONMEM, run NONMEM and import back to nlmixr2 with the following:

mod <- nlmixr(nlmixrFun, nlmmixrData, est="nonmem")

Copy Link

Version

Install

install.packages('babelmixr2')

Monthly Downloads

709

Version

0.1.8

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Matthew Fidler

Last Published

July 15th, 2025

Functions in babelmixr2 (0.1.8)

babelBpopIdx

Get the bpop_idx by variable name for a poped database created by babelmixr2
babel.poped.database

Expand a babelmixr2 PopED database
as.nlmixr2

Convert an object to a nlmixr2 fit object
popedGetMultipleEndpointModelingTimes

Get Multiple Endpoint Modeling Times
popedControl

Control for a PopED design task
pkncaControl

PKNCA estimation control
nonmemControl

NONMEM estimation control
nmGetDistributionMonolixLines

This is a S3 method for getting the distribution lines for a base rxode2 saem problem
bblDatToMonolix

Convert nlmixr2-compatible data to other formats (if possible)
nmGetDistributionNonmemLines

This is a S3 method for getting the distribution lines for a base rxode2 saem problem
.popedW

Get the weight from the rxode2 solve
popedMultipleEndpointResetTimeIndex

Reset the Global Time Indexer for Multiple Endpoint Modeling
.setupPopEDdatabase

Setup the poped database
.popedSetup

Setup the PopED environment
.popedSolveIdME

Solve poped problem for appropriate times with single/multiple endpoint models
monolixControl

Monolix Controller for nlmixr2
nlmixr2Est.pknca

Estimate starting parameters using PKNCA
rxToMonolix

Convert RxODE syntax to monolix syntax
reexports

Objects exported from other packages
simplifyUnit

Simplify units by removing repeated units from the numerator and denominator
rxToNonmem

Convert RxODE syntax to NONMEM syntax
popedMultipleEndpointParam

Populates Multiple Endpoint Parameters for internal solving
.popedFree

Free Poped memory (if any is allocated)
getStandardColNames

Determine standardized rxode2 column names from data
.popedF

Get the function value from the rxode2 solve
.popedCluster

Internal function to use with PopED to run PopED in parallel on Windows
.popedRxRunSetup

Setup poped if needed
modelUnitConversion

Unit conversion for pharmacokinetic models