plotPK: Plot concentration vs. time curve for individuals and...

View source: R/plotPK.R

plotPKR Documentation

Plot concentration vs. time curve for individuals and collectively.

Description

Generates individual and superposed concentration vs. time curves and saves them in pdf and tiff files.

Usage

plotPK(concData, id, Time, conc, unitTime = "hr", unitConc = "ng/mL", trt = "",
       fit = "Linear", dose = 0, adm = "Extravascular", dur = 0, outdir = "Output",
       name = "")

Arguments

concData

name of data table containing time-concentration data of multiple subjects

id

column name for subject ID

Time

column name for the time

conc

column name for the concentration

unitTime

unit for the time

unitConc

unit for the concentration

trt

column name for the treatment code. This is useful for crossover study like bioequivalence trial.

fit

one of "Linear" or "Log" to indicate the way to calculate AUC

dose

administered dose. One should be careful for the unit. This can be a vector containing dose for each subject and treatment in order.

adm

one of "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode

dur

infusion duration for constant infusion, otherwise 0. This can be a vector containing values for each subject and treatment in order.

outdir

name of the folder to be used for the output files. "" means the current working directory.

name

stem used in the output file names. "" means the deparsed concData argument, sanitized so that it is a valid file name.

Details

This function generates five figures: individual linear and semi-logarithmic profiles (one pdf each, several panels per page) and pooled linear, semi-logarithmic and mean with 95% confidence interval profiles (one tiff each, or png where the R build has no tiff device).

Each subject gets its own colour and plotting symbol whatever the number of subjects, and the subject legend is drawn in a panel of its own so that it cannot overlap the curves. When there are more subjects than can be labelled legibly, the count is shown instead of an unreadable legend. Treatment panels are laid out in a grid of at most four columns, so a study with many treatments neither exhausts the figure margins nor produces an enormous raster.

Non-finite times and concentrations are dropped from the axis ranges, and the semi-logarithmic figures use only positive concentrations. The semi-logarithmic axis is aligned to whole decades enclosing the data, so a labelled tick is always visible.

This function calls NCA().

Value

Invisibly, a character vector of the paths written. The files are saved in the outdir folder.

Author(s)

Jee Eun Lee <JeeEun.Lee@fda.hhs.gov>, Kyun-Seop Bae <k@acr.kr>

See Also

NCA

Examples

# plotPK(Theoph, "Subject", "Time", "conc", unitTime="hr", unitConc="mg/L", dose=320)
# plotPK(Indometh, "Subject", "time", "conc", unitTime="hr", unitConc="mg/L", adm="Bolus", dose=25)

pkr documentation built on July 30, 2026, 5:08 p.m.