Targets for 'nlmixr2' Pipelines

'nlmixr2' often has long runtimes. A pipeline toolkit tailored to 'nlmixr2' workflows leverages 'targets' and 'nlmixr2' to ease reproducible workflows. 'nlmixr2targets' ensures minimal rework in model development with 'nlmixr2' and 'targets' by simplifying and standardizing models and datasets.


nlmixr2targets

Lifecycle:experimental CRANstatus RTargetopia R-CMD-check Codecov testcoverage

The goal of nlmixr2targets is to simplify the use of the nlmixr2 package with the targets package. nlmixr2targets is part of the targetopeia.

Installation

When available on CRAN, you can install the released version of nlmixr2targets from CRAN with:

install.packages("nlmixr2targets")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("nlmixr2/nlmixr2targets")

Example

This is a basic example which shows you how to solve a common problem:

library(targets)
targets::tar_script({
  library(nlmixr2targets)
  pheno <- function() {
    ini({
      tcl <- log(0.008) # typical value of clearance
      tv <-  log(0.6)   # typical value of volume
      ## var(eta.cl)
      eta.cl + eta.v ~ c(1,
                         0.01, 1) ## cov(eta.cl, eta.v), var(eta.v)
      # interindividual variability on clearance and volume
      add.err <- 0.1    # residual variability
    })
    model({
      cl <- exp(tcl + eta.cl) # individual value of clearance
      v <- exp(tv + eta.v)    # individual value of volume
      ke <- cl / v            # elimination rate constant
      d/dt(A1) = - ke * A1    # model differential equation
      cp = A1 / v             # concentration in plasma
      cp ~ add(add.err)       # define error model
    })
  }
  list(
    tar_nlmixr(name=pheno_model, object=pheno, data=nlmixr2data::pheno_sd, est="saem")
  )
})
targets::tar_make()

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("nlmixr2targets")

0.1.0 by Bill Denney, 4 months ago


https://nlmixr2.github.io/nlmixr2targets/


Report a bug at https://github.com/nlmixr2/nlmixr2targets/issues


Browse source code at https://github.com/cran/nlmixr2targets


Authors: Bill Denney [aut, cre]


Documentation:   PDF Manual  


GPL (>= 2) license


Imports checkmate, digest, nlmixr2est, rxode2, targets

Suggests covr, knitr, nlmixr2data, rmarkdown, spelling, tarchetypes, testthat, withr


Suggested by nlmixr2.


See at CRAN