Skip to contents

Any compartment property lines for the depot (f(), lag(), dur(), rate() or an initial condition) are removed with its differential equation; the variables that defined them are left in place (use [removeLinesAndInis()] to drop them as well).

Usage

removeDepot(ui, central = "central", depot = "depot", ka = "ka", model)

Arguments

ui

The model as a function (or something convertible to an rxUi object)

central

central compartment name

depot

depot compartment name

ka

absorption rate parameter name

model

Deprecated alias for ui. Supplying model instead of ui still works but emits a deprecation warning.

Value

Returns a model with the depot from a first order absorption model removed

Examples

readModelDb("PK_1cmt_des") |> removeDepot()
#>  
#>  
#>  ── rxode2-based free-form 1-cmt ODE model ────────────────────────────────────── 
#>  ── Initalization: ──  
#> Fixed Effects ($theta): 
#>    lcl    lvc propSd 
#>   1.00   3.45   0.50 
#> 
#> States ($state or $stateDf): 
#>   Compartment Number Compartment Name
#> 1                  1          central
#>  ── Model (Normalized Syntax): ── 
#> function() {
#>     compartmentData <- list(depot = list(analyte = "drug", units = NA_character_, 
#>         specimen = "administration site", verified = FALSE), 
#>         central = list(analyte = "drug", units = NA_character_, 
#>             specimen = "plasma", verified = FALSE))
#>     dosing <- c("central", "depot")
#>     reference <- "nlmixr2lib template"
#>     units <- list(time = "time_unit", dosing = "dose_unit", concentration = "conc_unit/vol_unit")
#>     ini({
#>         lcl <- 1
#>         label("Clearance (CL)")
#>         lvc <- 3.45
#>         label("Central volume of distribution (V)")
#>         propSd <- c(0, 0.5)
#>         label("Proportional residual error (fraction)")
#>     })
#>     model({
#>         cl <- exp(lcl)
#>         vc <- exp(lvc)
#>         kel <- cl/vc
#>         d/dt(central) <- -kel * central
#>         Cc <- central/vc
#>         Cc ~ prop(propSd)
#>     })
#> }