panel.thalf: Panel function for elimination half life

View source: R/panel.thalf.r

panel.thalfR Documentation

Panel function for elimination half life

Description

Panel function to create individual plots with terminal half life predictions

Usage

panel.thalf(
  x,
  y,
  ...,
  text.cex = 0.8,
  line.col = "blue",
  digits = 3,
  unit = "hr"
)

Arguments

x, y

numeric vectors x and y

...

any other arguments passed on to the lattice call

text.cex

text font size

line.col

line color

digits

number of significant digits in output

unit

time unit (hr)

Value

Lattice panel output (invisible)

Examples

library(lattice)
pkpdData = example.pkpdData()
pkpdData$blq = 0
pkpdData$blq[pkpdData$type == "PK"&pkpdData$value<0.1] = 1
xyplot(value ~ time | id
, data = subset(pkpdData, blq == 0)
, subset = type == "PK" & dose == 100 & value > 1e-6
, groups = id
, panel = function(x,y, ...)
{
  panel.xyplot(x,y,..., col = "gray", pch = 18, type = "b", cex = 1)
  sel = length(x)
  sel = seq(sel-3,sel)
  panel.thalf(x[sel],y[sel],...,lwd = 2)
  lpoints(x,y, col = steel)
}
, scales = list(y = list(log = 10))
, yscale.components = yscale.components.log10
)

qPharmetra/qpToolkit documentation built on May 24, 2023, 8:52 a.m.