The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

nlmixr2targets

Lifecycle: experimental CRAN status R Targetopia R-CMD-check Codecov test coverage

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()

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.