tad | R Documentation |
tad()
computes the time after dose, adding a new column to a data frame.
tad(data, cond = "", expand = FALSE)
data |
A data frame or data frame extension in NONMEM format.. |
cond |
A filtering condition that specifies for which rows to calculate TAD, as a string (optional). |
expand |
Whether to expand the ADDL column in the result. |
tad()
assumes NONMEM-formatted data. It will expand the ADDL column internally,
but will return the data in its non-expanded form unless expand
is set to TRUE.
Expressions in ...
are used to determine under what conditions a
row of data
should count as a "dose" for calculating time after dose. This
is especially useful if there is more than one type of dose event, and TAD
should only apply to one of them. For example, suppose the DV column of
data
contains concentrations of a drug X. If a flag column "Y_FLAG"
exists to indicate that a drug Y is given, as opposed to X, passing
Y_FLAG = 0
to ...
will ensure that TAD is only calculated with respect to
drug X dosing events.
A tibble::tibble()
with an appended column, TAD, containing the
time after since the most recent dose for each observation record.
Sandy Floren
# Basic TAD calculation
tad(pk_example)
# compute TAD only for even ID numbers, and return in expanded form
tad(pk_example, "ID %% 2 == 0", expand = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.