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

Description Usage Arguments Value See Also Examples

View source: R/linpk.R

Description

Get the final state or time of a PK profile.

Usage

1
2
3

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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)

linpk documentation built on June 12, 2018, 5:04 p.m.