Skip to contents

Plot rxode2 objects

Usage

# S3 method for class 'rxSolve'
plot(x, y, ..., log = "", xlab = "Time", ylab = "")

# S3 method for class 'rxSolveConfint1'
plot(x, y, ..., xlab = "Time", ylab = "", log = "")

# S3 method for class 'rxSolveConfint2'
plot(x, y, ..., xlab = "Time", ylab = "", log = "")

Arguments

x

rxode2 object to plot

y

Compartments or left-hand-side values to plot either as a bare name or as a character vector

...

Ignored

log

Should "" (neither x nor y), "x", "y", or "xy" (or "yx") be log-scale?

xlab, ylab

The x and y axis labels

Value

A ggplot2 object

See also

Examples

# \donttest{
mod <- function() {
  ini({
    tka <- log(1.1)
    tcl <- log(3)
    tv <- log(30)
  })
  model({
    ka <- exp(tka)
    cl <- exp(tcl)
    v <- exp(tv)
    d/dt(depot) <- -ka * depot
    d/dt(central) <- ka * depot - cl / v * central
    cp <- central / v
  })
}
s <- rxSolve(mod, et(amt = 100) |> et(seq(0, 24, by = 0.5)))
#>  
#>  
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#>  
#>  
plot(s, cp)

plot(s, c("depot", "central"), log = "y")
#> Warning: some requested items do not exist in the solved object and were ignored: c
#> Warning: log-10 transformation introduced infinite values.

# }