pkprofile: Generate a concentration-time profile.

Description Usage Arguments Value Methods (by class) Warning See Also Examples

View source: R/linpk.R

Description

This function generates concentration-time profiles from a linear pharmacokinetic (PK) system, possibly with first-order absorption or zero-order infusion, possibly with one or more peripheral compartments, and possibly under steady-state conditions. Single or multiple doses may be specified.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
pkprofile(...)

## Default S3 method:
pkprofile(t.obs = seq(0, 24, 0.1), cl = 1, vc = 5,
  q = numeric(0), vp = numeric(0), ka = 0, dose = list(t.dose = 0, amt =
  1, rate = 0, dur = 0, ii = 24, addl = 0, ss = 0, cmt = 0, lag = 0, f = 1),
  sc = vc, initstate = NULL, ...)

## S3 method for class 'matrix'
pkprofile(A, t.obs = seq(0, 24, 0.1), dose = list(t.dose =
  0, amt = 1, rate = 0, dur = 0, ii = 24, addl = 0, ss = 0, cmt = 0, lag = 0, f
  = 1), defdose = 1, sc = 1, initstate = NULL, ...)

Arguments

...

Further arguments passed along to other methods.

t.obs

A numeric vector of times at which to observe concentrations.

cl

Central clearance parameter.

vc

Central volume parameter.

q

Inter-compartmental clearance. Can be a vector for more than one peripheral compartment, or empty for none. Must match vp in length.

vp

Peripheral volume. Can be a vector for more than one peripheral compartment, or empty for none. Must match q in length.

ka

First-order absorption rate parameter. Set to 0 to indicate that there is no first-order absorption (i.e. bolus or infusion).

dose

A list or data.frame containing dose information. May contain the following elements:

t.dose

Dose time (default 0).

amt

Dose amount (default 1).

rate

Rate of zero-order infusion, or 0 to ignore (default 0). Only one of rate and dur should be specified unless amt is missing.

dur

Duration of zero-order infusion, or 0 to ignore (default 0). Only one of rate and dur should be specified unless amt is missing.

ii

Interdose interval (default 24). Only used if addl or ss are used.

addl

Number of additional doses (default 0). The total number of doses given is addl + 1.

ss

Indicates that a dose is given under steady-state conditions (default 0 or FALSE; converted to logical internally).

cmt

The number of the compartment into which the dose is administered. The default value is 0, which indicates the depot compartment for first-order absorption (i.e. ka > 0), and central compartment otherwise.

lag

Time lag (default 0).

f

Bioavailable fraction (default 1).

sc

A scaling constant for the central compartment. Concentrations are obtained by dividing amounts by this constant.

initstate

A numeric vector containing values to initialize the compartments.

A

A matrix of first-order rate constants between the compartments.

defdose

The default dose compartment when the compartment is missing or 0.

Value

An object of class "pkprofile", which simply a numeric vector of concentration values with some attributes attached to it. This object has its own methods for print, plot, lines and points.

Methods (by class)

Warning

Pay attention to the default arguments. They are there for convenience, but may lead to undesired results if one is not careful.

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Default values, a bolus injection
y <- pkprofile()
plot(y)

t.obs <- seq(0, 24, 0.1)
dur <- 1
amt <- 1
ka <- 1
cl <- 0.25
vc <- 5
q <- 2.5
vp <- 10

# One-compartment model with first-order absorption, single dose
y <- pkprofile(t.obs, cl=cl, vc=vc, ka=ka, dose=list(amt=amt))
plot(y)

# Two-compartment model with first-order absorption, single dose
y <- pkprofile(t.obs, cl=cl, vc=vc, vp=vp, q=q, ka=ka, dose=list(amt=amt))
plot(y)

# One-compartment model with zero-order infusion, single dose
y <- pkprofile(t.obs, cl=cl, vc=vc, dose=list(dur=dur, amt=amt))
plot(y)

# Two-compartment model with zero-order infusion, single dose
y <- pkprofile(t.obs, cl=cl, vc=vc, vp=vp, q=q, dose=list(dur=dur, amt=amt))
plot(y)

# Two-compartment model with bolus injection, single dose
y <- pkprofile(t.obs, cl=cl, vc=vc, vp=vp, q=q, dose=list(amt=amt))
plot(y)

# Two-compartment model with bolus injection into the peripheral compartment, single dose
y <- pkprofile(t.obs, cl=cl, vc=vc, vp=vp, q=q, dose=list(amt=amt, cmt=2))
plot(y)

# Two-compartment model with zero-order infusion into the peripheral compartment, single dose
y <- pkprofile(t.obs, cl=cl, vc=vc, vp=vp, q=q, dose=list(amt=amt, cmt=2, dur=dur))
plot(y)

t.obs <- seq(0, 24*6, 1)

# One-compartment model with first-order absorption, multiple doses
y <- pkprofile(t.obs, cl=cl, vc=vc, ka=ka, dose=list(t.dose=seq(0, 24*5, 12), amt=amt))
plot(y)

# One-compartment model with first-order absorption, multiple doses specified by addl and ii
y <- pkprofile(t.obs, cl=cl, vc=vc, ka=ka, dose=list(t.dose=0, amt=amt, addl=9, ii=12))
plot(y, type="b")
points(y, col="blue")

# One-compartment model with first-order absorption, multiple doses under steady-state conditions
yss <- pkprofile(t.obs, cl=cl, vc=vc, ka=ka, dose=list(t.dose=0, amt=amt, addl=9, ii=12, ss=1))
lines(yss, col="red")
points(yss, col="green")

# One-compartment model with zero-order infusion, multiple doses specified by addl and ii
y <- pkprofile(t.obs, cl=cl, vc=vc, dose=list(dur=dur, amt=amt, addl=9, ii=12))
plot(y, log="y")

# One-compartment model with zero-order infusion, multiple doses  under steady-state conditions
yss <- pkprofile(t.obs, cl=cl, vc=vc, dose=list(dur=dur, amt=amt, addl=9, ii=12, ss=1))
lines(yss, col="red")

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