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

493

Version

0.1.11

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Matthew Fidler

Last Published

November 28th, 2025

Functions in babelmixr2 (0.1.11)

popedMultipleEndpointResetTimeIndex

Reset the Global Time Indexer for Multiple Endpoint Modeling
reexports

Objects exported from other packages
popedMultipleEndpointParam

Populates Multiple Endpoint Parameters for internal solving
popedGetMultipleEndpointModelingTimes

Get Multiple Endpoint Modeling Times
simplifyUnit

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

Convert RxODE syntax to NONMEM syntax
pseudoOptimControl

Control for fmeMcmc estimation method in nlmixr2
getStandardColNames

Determine standardized rxode2 column names from data
pkncaControl

PKNCA estimation control
popedControl

Control for a PopED design task
nmGetDistributionNonmemLines

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

NONMEM estimation control
rxToMonolix

Convert RxODE syntax to monolix syntax
as.nlmixr2

Convert an object to a nlmixr2 fit object
.popedFree

Free Poped memory (if any is allocated)
babelBpopIdx

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

Convert nlmixr2-compatible data to other formats (if possible)
babel.poped.database

Expand a babelmixr2 PopED database
fmeMcmcControl

Control for fmeMcmc estimation method in nlmixr2
.setupPopEDdatabase

Setup the poped database
nlmixr2Est.pknca

Estimate starting parameters using PKNCA
monolixControl

Monolix Controller for nlmixr2
modelUnitConversion

Unit conversion for pharmacokinetic models
.popedSetup

Setup the PopED environment
.popedCluster

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

Get the function value from the rxode2 solve
.pseudoOptimF

When the model is loaded, this function is called to evaluate the -2* log-likelihood value for FME::modMCMC()
.fmeMcmcF

When the model is loaded, this function is called to evaluate the -2* log-likelihood value for FME::modMCMC()
.popedSolveIdME

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

Get the weight from the rxode2 solve
nmGetDistributionMonolixLines

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

Setup poped if needed