finalstate: Get the final state or time of a PK profile.

View source: R/linpk.R

finalstateR Documentation

Get the final state or time of a PK profile.

Description

Get the final state or time of a PK profile.

Usage

finalstate(x)

finaltime(x)

Arguments

x

A object of class pkprofile.

Value

A numeric vector containing the state of each compartment at the final observation time (finalstate), or the final observation time itself (finaltime).

See Also

  • pkprofile for generating a PK profile.

  • pkprofile.pkprofile for appending to an existing PK profile.

Examples

# Administer a dose at time 0 and a second dose using the final state
# from the first dose (at 12h) as the initial state for the second dose.
t.obs <- seq(0, 12, 0.1)
y <- pkprofile(t.obs, cl=0.25, vc=5, ka=1, dose=list(t.dose=0, amt=1))
finalstate(y)
y2 <- pkprofile(t.obs, cl=0.25, vc=5, ka=1, dose=list(t.dose=0, amt=1), initstate=finalstate(y))
plot(y, xlim=c(0, 24), ylim=c(0, max(y2)), col="blue")  # First dose
lines(t.obs+12, y2, col="red")                          # Second dose

# Add a vertical line to show where the first profile ends.
abline(v=finaltime(y), col="gray75", lty=2)

benjaminrich/linpk documentation built on April 18, 2024, 2:13 a.m.