Returns a reporting-ready summary table of individual NCA ratio results from a PKanalix project. Supports stratification by covariates, wide or vertical layouts, per-parameter rounding, custom aliases, and optional inclusion of individual subject values.
Usage
tableNCARatios(projectFile = NULL,
splitCovariates = NULL,
stratifyColumns = FALSE,
covariateLabels = NULL,
selectParameters = NULL,
metrics = NULL,
useWideFormat = TRUE,
includeId = FALSE,
filterCovariates = NULL,
filterIds = NULL,
roundDigits = 3,
roundMethod = c("monolixSuiteRounding", "significantFigures", "significantFiguresPreserved", "none"),
roundByParameter = NULL,
prettyLabels = TRUE,
customAliases = NULL,
mock = FALSE)
Arguments
-
projectFile(character) Path to a PKanalix project file (.pkx). IfNULL(default), uses the currently loaded project. -
splitCovariates(character) Column name(s) to stratify by (must exist in the individual-ratio data, excluding id/ratio columns), e.g."DOSE"orc("DOSE","VISIT"). IfNULL(default), no stratification. -
stratifyColumns(logical) IfTRUE, creates separate columns per covariate combination plus an "Overall" column. IfFALSE(default), covariates appear as left-side columns. Only applies whensplitCovariatesis set anduseWideFormat = FALSE. -
covariateLabels(character) Custom labels forsplitCovariates(same length). IfNULL(default), the original covariate names are used. Shown in headers whenstratifyColumns = TRUE. -
selectParameters(character) Ratio parameter names to include. IfNULL(default), all available ratio parameters are used. -
metrics(character) Summary statistics to include. IfNULL(default), all available metrics are included. Accepted values (returned bygetDescriptiveStatsMetrics(), in calculation order):-
Counts:
"N","Nobs" -
Range / percentiles:
"min","P05","Q1","median","Q3","P95","max" -
Central tendency & dispersion:
"mean","SD","SE","CV" -
Geometric / harmonic:
"geoMean","geoSD","geoCV","harmMean" -
Combined display metrics:
"MeanSD","MeanCV","GeomCV","GeomSD"
-
-
useWideFormat(logical) IfTRUE(default), returns a wide table; ifFALSE, results are pivoted to long format. -
includeId(logical) IfTRUE(withuseWideFormat = FALSEandstratifyColumns = FALSE), appends individual subject ratio values below the summary statistics. DefaultFALSE. -
filterCovariates(list) Named list of categorical covariates → allowed values, e.g.list(SEX = "Male"). IfNULL(default), no covariate filtering is applied. -
filterIds(character/numeric) Subject IDs to include. IfNULL(default), no ID filtering is applied. -
roundDigits(integer) Number of decimal places for rounding (default3). -
roundMethod(character) How numeric values are rounded.roundDigitscontrols the number of digits in each case. Options:-
"monolixSuiteRounding"(default) - Mirrors MonolixSuite display. The integer part is kept exactly as-is, and only the fractional part is rounded toroundDigitssignificant figures. Small values (< 1) automatically get more decimal places. -
"significantFigures"- Standard significant-figures rounding: the value is rounded toroundDigitstotal significant digits, zeroing non-significant digits before the decimal for large numbers. -
"significantFiguresPreserved"- Like"significantFigures", but never zeroes digits before the decimal. Once the integer part already has at leastroundDigitsdigits, the value is simply rounded to the nearest whole number instead of being zeroed out. -
"none"- No rounding; values are returned as-is.
-
-
roundByParameterOptional per-parameter rounding overrides on top of the global settings, either a named numeric vector of digits (c(AUClast_ratio = 2, Cmax_ratio = 4)) or a 3-column data frame (parameter,digits,method). Unlisted parameters keep global settings (defaultNULL). -
prettyLabels(logical) IfTRUE(default), converts column names to human-readable labels. -
customAliases(character / data.frame) Named vector or 2-column data frame mapping parameters → custom alias labels. (Ratios are dimensionless, so there is nounitsargument.) -
mock(logical) IfTRUE, masks values for documentation/examples (metric values become"xx.xx", covariate levels become"Category 1"…, IDs become"id1"…). DefaultFALSE.
Returns: A data frame of summary statistics (N, Min, Q1, Mean, Median, Q3, Max) for each ratio parameter, optionally stratified; when includeId = TRUE, also individual per-subject ratio values.
Examples