Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cd66967
add.interval.col: add formula arg (default NULL)
Gero1999 Jan 15, 2026
60086df
add formula to PK parameters (LaTeX; double slash for R compatibility)
Gero1999 Jan 15, 2026
a6ce5e4
v03: add Formula column in vignette table
Gero1999 Jan 15, 2026
04493d5
try: render latex in kable
Gero1999 Jan 15, 2026
797c1e1
make a file that creates the table in markdown format
Gero1999 Mar 18, 2026
47e0ec7
final vignette to use for parameters table
Gero1999 Mar 18, 2026
0abc4f1
add missing formulas to the other add.interval.col calls
Gero1999 Mar 18, 2026
96d9806
generate new vignette with all formulas
Gero1999 Mar 18, 2026
b5dad7c
include more formulas
Gero1999 Mar 19, 2026
d0c1789
rename vignette name to differentiate it
Gero1999 Mar 19, 2026
851d128
try to relocate in navbar of the webpage
Gero1999 Mar 19, 2026
3babc5b
simplify nav structure
Gero1999 Mar 19, 2026
e3a20e4
merge main, 5 conflictive files solved
Gero1999 Mar 20, 2026
6f1d8c2
update parameters table
Gero1999 Mar 20, 2026
d8501e6
use regex to customize formulas in a loop for dn parameters
Gero1999 Mar 20, 2026
846ac3a
fix undetected issues from merge
Gero1999 Mar 20, 2026
1e26e61
fix tests failing
Gero1999 Mar 20, 2026
288f1af
add docs for formula param in add.interval.cols
Gero1999 Mar 20, 2026
84b713b
rm paramters that were already removed from main
Gero1999 Mar 20, 2026
7f3df24
fix: rm more sparse parameters
Gero1999 Mar 20, 2026
8734aff
rm change in test-pk.calc.all done
Gero1999 Mar 20, 2026
487c549
make changes suggested for formulas, add also formula_note column for…
Gero1999 Mar 24, 2026
da30dde
replace old parameters-available table
Gero1999 Mar 24, 2026
7b5c833
small refactoring
Gero1999 Mar 24, 2026
446a486
adapt test to new formula_note arg in add.interval.col()
Gero1999 Mar 25, 2026
0df82db
add missing man
Gero1999 Mar 25, 2026
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
5 changes: 5 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ export(pk.calc.aumc.inf)
export(pk.calc.aumc.inf.obs)
export(pk.calc.aumc.inf.pred)
export(pk.calc.aumc.last)
export(pk.calc.aumcint)
export(pk.calc.aumcint.all)
export(pk.calc.aumcint.inf.obs)
export(pk.calc.aumcint.inf.pred)
export(pk.calc.aumcint.last)
export(pk.calc.auxc)
export(pk.calc.c0)
export(pk.calc.cav)
Expand Down
9 changes: 7 additions & 2 deletions R/001-add.interval.col.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ assign("interval.cols", list(), envir=.PKNCAEnv)
#' to NCA parameter names. See the details for information on use of
#' `formalsmap`.
#' @param datatype The type of data used for the calculation
#' @param formula Character value providing a LaTeX expression to identify how the
#' calculation of the parameter is performed. It is an optional argument merely
#' used for documentation.
#' @returns NULL (Calling this function has a side effect of changing the
#' available intervals for calculations)
#'
Expand Down Expand Up @@ -90,7 +93,8 @@ add.interval.col <- function(name,
formalsmap=list(),
datatype=c("interval",
"individual",
"population")) {
"population"),
formula=NULL) {
# Check inputs
if (!is.character(name)) {
stop("name must be a character string")
Expand Down Expand Up @@ -170,7 +174,8 @@ add.interval.col <- function(name,
sparse=sparse,
formalsmap=formalsmap,
depends=depends,
datatype=datatype
datatype=datatype,
formula=formula
)
assign("interval.cols", current, envir=.PKNCAEnv)
}
Expand Down
27 changes: 17 additions & 10 deletions R/auc.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pk.calc.auxc <- function(conc, time, interval=c(0, Inf),
}
auc.type <- match.arg(auc.type)
interval <- assert_intervaltime_single(interval = interval)
if (auc.type %in% "AUCinf" & is.finite(interval[2])) {
if (auc.type %in% "AUCinf" && is.finite(interval[2])) {
warning("Requesting AUCinf when the end of the interval is not Inf")
}

Expand Down Expand Up @@ -318,60 +318,67 @@ add.interval.col("aucinf.obs",
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",
depends=c("lambda.z", "clast.obs"))
depends=c("lambda.z", "clast.obs"),
formula="$AUC_{\\infty,\\text{obs}} = AUC_{0-\\text{last}} + \\frac{C_{\\text{last,obs}}}{\\lambda_z}$")

add.interval.col("aucinf.pred",
FUN="pk.calc.auc.inf.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",
depends=c("lambda.z", "clast.pred"))
depends=c("lambda.z", "clast.pred"),
formula="$AUC_{\\infty,\\text{pred}} = AUC_{0-\\text{last}} + \\frac{C_{\\text{last,pred}}}{\\lambda_z}$")

add.interval.col("auclast",
FUN="pk.calc.auc.last",
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="The area under the concentration time curve from the beginning of the interval to the last concentration above the limit of quantification",
formula="$AUC_{\\text{last}} = \\int_{0}^{T_{\\text{last}}} C(t) dt$")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integral formulae are technically accurate, but they are not how the formula are actually calculated. The actual calculation is more complex as it depends on the integration method. It's hard to show this (and all AUC calculations) in a single formula as they are more easily described with algorithms. (This will probably take more thought.)


add.interval.col("aucall",
FUN="pk.calc.auc.all",
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="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",
formula="$AUC_{\\text{all}} = \\int_{0}^{T_{\\text{end}}} C(t) dt$")

add.interval.col("aumcinf.obs",
FUN="pk.calc.aumc.inf.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",
depends=c("lambda.z", "clast.obs"))
depends=c("lambda.z", "clast.obs"),
formula="$AUMC_{\\infty,\\text{obs}} = AUMC_{0-\\text{last}} + \\frac{C_{\\text{last,obs}} T_{\\text{last}}}{\\lambda_z} + \\frac{C_{\\text{last,obs}}}{\\lambda_z^2}$")

add.interval.col("aumcinf.pred",
FUN="pk.calc.aumc.inf.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",
depends=c("lambda.z", "clast.pred"))
depends=c("lambda.z", "clast.pred"),
formula="$AUMC_{\\infty,\\text{pred}} = AUMC_{0-\\text{last}} + \\frac{C_{\\text{last,pred}} T_{\\text{last}}}{\\lambda_z} + \\frac{C_{\\text{last,pred}}}{\\lambda_z^2}$")

add.interval.col("aumclast",
FUN="pk.calc.aumc.last",
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="The area under the concentration time moment curve from the beginning of the interval to the last concentration above the limit of quantification",
formula="$AUMC_{\\text{last}} = \\int_{0}^{T_{\\text{last}}} C(t) t dt$")

add.interval.col("aumcall",
FUN="pk.calc.aumc.all",
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="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",
formula="$AUMC_{\\text{all}} = \\int_{0}^{T_{\\text{end}}} C(t) t dt$")

PKNCA.set.summary(
name=
Expand Down
Loading
Loading