This function creates a dataset with dose intervals and specified pharmacokinetic parameters.
Usage
format_pkncadata_intervals(
pknca_conc,
pknca_dose,
params = c("aucinf.obs", "aucint.last", "auclast", "cmax", "half.life", "tmax",
"lambda.z", "lambda.z.n.points", "r.squared", "adj.r.squared", "lambda.z.time.first",
"aucpext.obs", "aucpext.pred", "clast.obs", "cl.obs"),
start_from_last_dose = TRUE
)
Details
The function performs the following steps:
Creates a vector with all pharmacokinetic parameters.
Based on dose times, creates a data frame with start and end times.
If TAU column is present in data, sets last dose end time to start + TAU, or if TAU is NA then either Inf if only one dose present, or max end time if not.
If no TAU column in data, sets last dose end time to the time of last sample or Inf if single dose data.
Adds logical columns for each specified parameter.
Assumes that multiple dose data will have a TAU column or contain multiple doses in dataset