Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method(AIC,list)
S3method(PKNCAconc,data.frame)
S3method(PKNCAconc,default)
S3method(PKNCAconc,tbl_df)
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ the dosing including dose amount and route.

# Development version

* Parameter descriptions in `add.interval.col()` are now limited to 40
characters to comply with SDTM requirements.

* Bug fix: `pk.nca()` no longer errors on unsorted concentration-time data.
Group-level concentration data are now sorted by time before calculation, so
parameters that use the full group (e.g. `aucint.all` and the other `aucint*`
Expand Down
6 changes: 3 additions & 3 deletions R/001-add.interval.col.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ add.interval.col <- function(name,
checkmate::assert_character(x = FUN, len = 1, any.missing = TRUE) # allows NA
checkmate::assert_logical(x = sparse, len = 1, any.missing=FALSE)
checkmate::assert_character(x = pretty_name, len = 1, min.chars = 1, any.missing=FALSE)
checkmate::assert_character(x = desc, len = 1, any.missing=FALSE)
checkmate::assert_character(x = desc, len = 1, any.missing=FALSE, max.chars = 40)
checkmate::assert_character(x = depends, null.ok = TRUE)

# `values` must be either a function (used to validate/coerce) or a vector
Expand Down Expand Up @@ -200,7 +200,7 @@ add.interval.col <- function(name,
# Ensure formalsmap names are unique
checkmate::assert_character(x = names(formalsmap), min.chars = 1, any.missing = FALSE)
}

# Ensure that the function exists
if (!is.na(FUN)) {
# Ensure that the function exists
Expand Down Expand Up @@ -341,5 +341,5 @@ add.interval.col(
values = as.numeric,
unit_type="time",
pretty_name="Interval End",
desc = "Ending time of the interval (potentially infinity)"
desc = "End time of interval (may be Inf)"
)
16 changes: 8 additions & 8 deletions R/auc.R
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ add.interval.col("aucinf.obs",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUCinf,obs",
desc="The area under the concentration time curve from the beginning of the interval to infinity with extrapolation to infinity from the observed Clast",
desc="AUC start to inf, obs Clast extrap",
depends=c("lambda.z", "clast.obs"),
pptestcd_cdisc="AUCIFO",
pptest_cdisc="AUC Infinity Obs")
Expand All @@ -353,7 +353,7 @@ add.interval.col("aucinf.pred",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUCinf,pred",
desc="The area under the concentration time curve from the beginning of the interval to infinity with extrapolation to infinity from the predicted Clast",
desc="AUC start to inf, pred Clast extrap",
depends=c("lambda.z", "clast.pred"),
pptestcd_cdisc="AUCIFP",
pptest_cdisc="AUC Infinity Pred")
Expand All @@ -363,7 +363,7 @@ add.interval.col("auclast",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUClast",
desc="The area under the concentration time curve from the beginning of the interval to the last concentration above the limit of quantification",
desc="AUC start to last conc above LOQ",
pptestcd_cdisc="AUCLST",
pptest_cdisc="AUC to Last Nonzero Conc")

Expand All @@ -372,7 +372,7 @@ add.interval.col("aucall",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUCall",
desc="The area under the concentration time curve from the beginning of the interval to the last concentration above the limit of quantification plus the triangle from that last concentration to 0 at the first concentration below the limit of quantification",
desc="AUClast plus triangle, 0 at BLQ",
pptestcd_cdisc="AUCALL",
pptest_cdisc="AUC All")

Expand All @@ -381,7 +381,7 @@ add.interval.col("aumcinf.obs",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMC,inf,obs",
desc="The area under the concentration time moment curve from the beginning of the interval to infinity with extrapolation to infinity from the observed Clast",
desc="AUMC start to inf, obs Clast extrap",
depends=c("lambda.z", "clast.obs"),
pptestcd_cdisc="AUMCIFO",
pptest_cdisc="AUMC Infinity Obs")
Expand All @@ -391,7 +391,7 @@ add.interval.col("aumcinf.pred",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMC,inf,pred",
desc="The area under the concentration time moment curve from the beginning of the interval to infinity with extrapolation to infinity from the predicted Clast",
desc="AUMC start to inf, pred Clast extrap",
depends=c("lambda.z", "clast.pred"),
pptestcd_cdisc="AUMCIFP",
pptest_cdisc="AUMC Infinity Pred")
Expand All @@ -401,7 +401,7 @@ add.interval.col("aumclast",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMC,last",
desc="The area under the concentration time moment curve from the beginning of the interval to the last concentration above the limit of quantification",
desc="AUMC start to last conc above LOQ",
pptestcd_cdisc="AUMCLST",
pptest_cdisc="AUMC to Last Nonzero Conc")

Expand All @@ -410,7 +410,7 @@ add.interval.col("aumcall",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMC,all",
desc="The area under the concentration time moment curve from the beginning of the interval to the last concentration above the limit of quantification plus the moment of the triangle from that last concentration to 0 at the first concentration below the limit of quantification",
desc="AUMClast plus triangle moment, 0 at BLQ",
pptestcd_cdisc="AUMCALL",
pptest_cdisc="AUMC All")

Expand Down
32 changes: 16 additions & 16 deletions R/aucint.R
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ add.interval.col("aucint.last",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUCint (based on AUClast extrapolation)",
desc="The area under the concentration time curve in the interval extrapolating from Tlast to infinity with zeros (matching AUClast)",
desc="AUC from T1 to T2 (zero extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose=NULL),
pptestcd_cdisc="AUCINT",
pptest_cdisc="AUC from T1 to T2")
Expand All @@ -262,7 +262,7 @@ add.interval.col("aucint.last.dose",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUCint (based on AUClast extrapolation, dose-aware)",
desc="The area under the concentration time curve in the interval extrapolating from Tlast to infinity with zeros (matching AUClast) with dose-aware interpolation/extrapolation of concentrations",
desc="AUCdn T1 to T2 (zero extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose="time.dose.group"),
pptestcd_cdisc="AUCINTD",
pptest_cdisc="AUC from T1 to T2 Normalized by Dose")
Expand All @@ -272,7 +272,7 @@ add.interval.col("aucint.all",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUCint (based on AUCall extrapolation)",
desc="The area under the concentration time curve in the interval extrapolating from Tlast to infinity with the triangle from Tlast to the next point and zero thereafter (matching AUCall)",
desc="AUC from T1 to T2 (AUCall extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose=NULL),
pptestcd_cdisc="AUCINTA",
pptest_cdisc="AUCint (based on AUCall extrapolation)")
Expand All @@ -282,7 +282,7 @@ add.interval.col("aucint.all.dose",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUCint (based on AUCall extrapolation, dose-aware)",
desc="The area under the concentration time curve in the interval extrapolating from Tlast to infinity with the triangle from Tlast to the next point and zero thereafter (matching AUCall) with dose-aware interpolation/extrapolation of concentrations",
desc="AUCdn T1 to T2 (AUCall extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose="time.dose.group"),
pptestcd_cdisc="AUCINTAD",
pptest_cdisc="AUCint (based on AUCall extrapolation, dose-aware)")
Expand All @@ -292,7 +292,7 @@ add.interval.col("aucint.inf.obs",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUCint (based on AUCinf,obs extrapolation)",
desc="The area under the concentration time curve in the interval extrapolating from Tlast to infinity with zeros (matching AUClast)",
desc="AUC from T1 to T2 (AUCinf,obs extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose=NULL),
depends=c("lambda.z", "clast.obs"),
pptestcd_cdisc="AUCINTIS",
Expand All @@ -303,7 +303,7 @@ add.interval.col("aucint.inf.obs.dose",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUCint (based on AUCinf,obs extrapolation, dose-aware)",
desc="The area under the concentration time curve in the interval extrapolating from Tlast to infinity with zeros (matching AUClast) with dose-aware interpolation/extrapolation of concentrations",
desc="AUCdn T1 to T2 (AUCinf,obs extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose="time.dose.group"),
depends=c("lambda.z", "clast.obs"),
pptestcd_cdisc="AUCINTID",
Expand All @@ -314,7 +314,7 @@ add.interval.col("aucint.inf.pred",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUCint (based on AUCinf,pred extrapolation)",
desc="The area under the concentration time curve in the interval extrapolating from Tlast to infinity with the triangle from Tlast to the next point and zero thereafter (matching AUCall)",
desc="AUC from T1 to T2 (AUCinf,pred extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose=NULL),
depends=c("lambda.z", "clast.pred"),
pptestcd_cdisc="AUCINTIP",
Expand All @@ -325,7 +325,7 @@ add.interval.col("aucint.inf.pred.dose",
values=c(FALSE, TRUE),
unit_type="auc",
pretty_name="AUCint (based on AUCinf,pred extrapolation, dose-aware)",
desc="The area under the concentration time curve in the interval extrapolating from Tlast to infinity with the triangle from Tlast to the next point and zero thereafter (matching AUCall) with dose-aware interpolation/extrapolation of concentrations",
desc="AUCdn T1 to T2 (AUCinf,pred extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose="time.dose.group"),
depends=c("lambda.z", "clast.pred"),
pptestcd_cdisc="AUCINTPD",
Expand Down Expand Up @@ -407,7 +407,7 @@ add.interval.col("aumcint.last",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMCint (based on AUMClast extrapolation)",
desc="The area under the moment curve in the interval extrapolating from Tlast to infinity with zeros (matching AUMClast)",
desc="AUMC from T1 to T2 (zero extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose=NULL))

# aumcint.last.dose (WITH dose awareness)
Expand All @@ -416,7 +416,7 @@ add.interval.col("aumcint.last.dose",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMCint (based on AUMClast extrapolation, dose-aware)",
desc="The area under the moment curve in the interval extrapolating from Tlast to infinity with zeros (matching AUMClast) with dose-aware interpolation/extrapolation of concentrations",
desc="AUMCdn T1 to T2 (zero extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose="time.dose.group"))

# aumcint.all (without dose awareness)
Expand All @@ -425,7 +425,7 @@ add.interval.col("aumcint.all",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMCint (based on AUMCall extrapolation)",
desc="The area under the moment curve in the interval extrapolating from Tlast to infinity with the triangle from Tlast to the next point and zero thereafter (matching AUMCall)",
desc="AUMC from T1 to T2 (AUMCall extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose=NULL))

# aumcint.all.dose (WITH dose awareness)
Expand All @@ -434,7 +434,7 @@ add.interval.col("aumcint.all.dose",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMCint (based on AUMCall extrapolation, dose-aware)",
desc="The area under the moment curve in the interval extrapolating from Tlast to infinity with the triangle from Tlast to the next point and zero thereafter (matching AUMCall) with dose-aware interpolation/extrapolation of concentrations",
desc="AUMCdn T1 to T2 (AUMCall extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose="time.dose.group"))

# aumcint.inf.obs (without dose awareness)
Expand All @@ -443,7 +443,7 @@ add.interval.col("aumcint.inf.obs",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMCint (based on AUMCinf,obs extrapolation)",
desc="The area under the moment curve in the interval extrapolating from Tlast to infinity with zeros (matching AUMClast)",
desc="AUMC from T1 to T2 (AUMCinf,obs extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose=NULL),
depends=c("lambda.z", "clast.obs"))

Expand All @@ -453,7 +453,7 @@ add.interval.col("aumcint.inf.obs.dose",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMCint (based on AUMCinf,obs extrapolation, dose-aware)",
desc="The area under the moment curve in the interval extrapolating from Tlast to infinity with zeros (matching AUMClast) with dose-aware interpolation/extrapolation of concentrations",
desc="AUMCdn T1 to T2 (AUMCinf,obs extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose="time.dose.group"),
depends=c("lambda.z", "clast.obs"))

Expand All @@ -463,7 +463,7 @@ add.interval.col("aumcint.inf.pred",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMCint (based on AUMCinf,pred extrapolation)",
desc="The area under the moment curve in the interval extrapolating from Tlast to infinity with the triangle from Tlast to the next point and zero thereafter (matching AUMCall)",
desc="AUMC from T1 to T2 (AUMCinf,pred extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose=NULL),
depends=c("lambda.z", "clast.pred"))

Expand All @@ -473,7 +473,7 @@ add.interval.col("aumcint.inf.pred.dose",
values=c(FALSE, TRUE),
unit_type="aumc",
pretty_name="AUMCint (based on AUMCinf,pred extrapolation, dose-aware)",
desc="The area under the moment curve in the interval extrapolating from Tlast to infinity with the triangle from Tlast to the next point and zero thereafter (matching AUMCall) with dose-aware interpolation/extrapolation of concentrations",
desc="AUMCdn T1 to T2 (AUMCinf,pred extrap)",
formalsmap=list(conc="conc.group", time="time.group", time.dose="time.dose.group"),
depends=c("lambda.z", "clast.pred"))

Expand Down
Loading