| NEWS | R Documentation |
News for Package NonCompart
Changes in version 0.8.5 (2026-11-15)
This release corrects six calculations. The new results were checked against hand sums and closed-form values. Results for profiles without a zero concentration, without
SS=TRUEand without an interval AUC beyond the last positive concentration are unchanged: the eight reference comparisons of ‘tests/Test.R’ agree as before.Fixed
AUCwithdown="Log"for a segment that comes down from a positive concentration to zero. The segment went to the log branch, wherelog(0)made the rate constant infinite, so it added 0 to AUC and AUMC instead of its triangle. InsNCAthis lost the area before a zero inside the profile fromAUCLSTandAUMCLST, and with them fromAUCIFO,AUCIFP, CL, Vz, MRT and Vss, and it lost the triangle down to the first trailing zero fromAUCALL. Such a segment is now taken by the linear trapezoidal rule, asLogAUC(and thereforeiAUCandAUCTAU) always did. Onlydown="Log"with a positive concentration followed by a zero was affected.Steady state (
SS=TRUE): the MRT to infinity and Vss are now calculated from the dosing interval.MRTIVIFO,MRTIVIFP,MRTEVIFOandMRTEVIFPare (AUMC from 0 to tau + tau * (AUCinf - AUCTAU)) / AUCTAU, less half the infusion duration for an infusion, withAUCIFOorAUCIFPas AUCinf;VSSOandVSSPare that MRT timesCLO, the one steady-state clearance dose / AUCTAU. Up to 0.8.4 the four MRT andVSSPwereNAandVSSOwasMRTIVLSTtimesCLO, which for a one-compartment bolus of volume 20 gave 14.06. They areNAwhen lambda z cannot be estimated.VZP,CLP,VZFPandCLFPremainNAat steady state.Steady state: without a sample at dosing time, the point inserted there is now the lowest concentration observed within the dosing interval, for extravascular administration and infusion. Up to 0.8.4 it was 0, as after a single dose, which cut the first trapezoid down to a triangle and lowered
AUCLST,AUCALL,AUCTAU,CAVGand what is derived from them. The inserted point is not used for lambda z. A bolus (back-extrapolated C0) and single-dose data (0) are unchanged.Steady state:
CMAX,TMAXandCMAXDare now taken from the samples within the dosing interval, from 0 to tau. Up to 0.8.4 a higher concentration sampled after tau becameCMAXwhileAUCTAUandCAVGstopped at tau. Single-dose data still use the whole profile.IntAUC, and with itiAUCandAUCTAU, no longer returnsNAfor an interval that starts after the last positive concentration (TLST). After the last observation the concentration is predicted from the terminal regression and the area is the log trapezoid; betweenTLSTand a trailing zero it is interpolated linearly. Two details changed with it. An interval that starts beforeTLSTand ends betweenTLSTand a trailing zero is, withdown="Linear", linear throughout; the piece afterTLSTused to be a log trapezoid. And the part after the last observation takes the log trapezoid also when the predicted concentration is higher than the last observed one, where the linear rule was used before. An interval AUC on a flat profile that started after the first sample wasNAfor the same reason and is calculated now.The log trapezoid is evaluated in a form that keeps its accuracy for nearly equal concentrations. The textbook AUMC expression subtracts two terms of size 1/log(C1/C2); for concentrations 1 and 1 - 1e-12 over a unit interval it returned 0.49988 instead of 0.5. Ordinary segments agree with the previous version to about 1e-15.
sNCAnow passes the series with the point at dosing time to every interval AUC, for all routes, so thatAUCLST,AUCALL,AUCTAUandiAUCrest on the same initial point.‘tests/Test.R’: the comparator against the reference tables skipped every reference value of 0, compared only the columns both tables happened to have, paired rows by position, stopped on
NA, and accepted a relative difference of 0.001. It now pairs rows by the key and fails on a missing, extra or duplicated profile and on a missing parameter, compares zeros, treatsNAagainst a number as a difference, and uses a tolerance matched to each reference file: 1e-10 for the files with 15 significant digits (largest difference found 1.6e-14) and 1e-9 for those saved rounded to 10 significant digits (5.9e-9). Checks of the comparator itself were added.Added ‘tests/Test-IntAUC.R’ and new sections in ‘tests/Test-SS.R’, with hand sums and closed forms as reference values. Three assertions in ‘tests/Test-SS.R’ that pinned the former steady-state behaviour (
VSSOequal toMRTIVLSTtimesCLO, the MRT to infinityNA) were replaced.OQNCAgains a sixth Tier A case, an intravascular bolus at steady state whose reference row is closed form (MRT to infinity 1/k, Vss equal to the volume), and the steady-state extravascular reference now carries the MRT to infinity. A case now fails when a parameter or a subject of its reference table is absent from the result or a subject occurs twice; such rows used to drop out of the comparison.The formula document ‘inst/extdoc/NCA-Formula.pdf’ was re-rendered from its source. It gives the steady-state forms of MRTinf and Vss, the dosing-interval rule for Cmax and Tmax, and the point inserted at dosing time at steady state, and it states the linear rule for a log-down segment that ends at zero in place of a sentence saying that zero concentrations needed no treatment.
Changes in version 0.8.4 (2026-09-20)
Steady state is now analysed over the dosing interval.
sNCAandtblNCAgaintau(the dosing interval) andunitTau(its unit, default"h"), which are required whenSS=TRUE. Two parameters are added to the result:AUCTAU, the AUC from 0 to tau computed through the same interval-AUC engine asiAUC(a tau between two samples is interpolated according todown; a tau beyond the last measurable sample is reached by lambda z extrapolation), andCAVG, the average steady-state concentrationAUCTAU/tau. WithSS=TRUE,CLOandCLFOare nowdose/AUCTAU,VZOandVZFOaredose/AUCTAU/LAMZ, andVSSOfollows from the correctedCLO. Up to 0.8.3SS=TRUEputAUCLSTin their place, which equals AUCtau only when the last sample happens to fall exactly at tau and is otherwise not the steady-state clearance at all.VZFP,CLFP,MRTEVIFO,MRTEVIFPand their intravascular counterparts remainNAat steady state, as before.SS=TRUEwithouttaunow stops instead of silently computing a clearance from the wrong area; ataugiven withSS=FALSEis ignored with a warning.unitTauaccepts s, min, h, d and wk (and their common spellings) and converts tau intotimeUnit. IntblNCA,tauis a scalar or one value per NCA, likedoseanddur.An
iAUCname that collides with a standard parameter name (for example"AUCTAU"together withSS=TRUE) now stops with a message instead of overwriting the parameter in silence. Scripts that computed AUCtau themselves asiAUC=data.frame(Name="AUCTAU", Start=0, End=tau)next toSS=TRUEshould drop that entry and passtau; the value is identical. WithoutSSthe name stays free, so a first-dose"AUCTAU"still works.UnitknowsAUCTAU(time times concentration) andCAVG(concentration). An interval AUC that borrows the name of aUnitrow now overwrites that row instead of appending a duplicate, which stopped with “duplicate 'row.names' are not allowed”.Fixed the flat-profile branch of
sNCA(every concentration identical): an intravascular bolus with a time-0 sample and aniAUCrequest stopped with “object 'x2' not found”, and theunitsattribute of a flat profile withiAUCwas longer than the result because the interval-AUC units were appended twice.OQNCAgains two Tier A steady-state cases on a fixture whose AUCtau is the hand-summable trapezoid 66, once with tau in hours and once with the same tau in days. ‘inst/OQ/RptCfg.csv’ mapsAUCTAUandCAVGto the reference column namesAUC_TAUandCavg.‘tests/RptCfg.csv’ lacked the
WNLcolumn that ‘tests/Test.R’ reads to map the parameter names oftblNCAonto the reference columns. The lookup returnedNULL, no parameter column matched, and the eight reference comparisons in ‘tests/Test.R’ passed without comparing a single parameter value. The file now carries the same columns as ‘inst/OQ/RptCfg.csv’; all eight comparisons pass with the values actually compared. Added ‘tests/Test-SS.R’, which fails on the 0.8.3 build.The formula document ‘inst/extdoc/NCA-Formula.pdf’ gains the sections AUCtau (AUCTAU) and Cavg (CAVG), the steady-state forms of Vz, CL and Vss, and a worked steady-state example. Three errors in the previous edition were corrected: the linear trapezoid for AUClast was written with
C_i - C_{i-1}instead ofC_i + C_{i-1}, the log-down back-extrapolated area withC_0 + C_1instead ofC_0 - C_1, and the dose-normalised AUCinf sections appeared twice.
Changes in version 0.8.3 (2026-08-05)
Fixed
CLSTPin theUsePointsbranch ofsNCA. The mask was built fromy[UsePoints]but used to subset the full-lengthx; because the mask is shorter, R recycled it silently, and since terminal-slope points are always positive the mask was allTRUEand selected the whole ofx.CLSTPwas therefore extrapolated to the last sampling time instead ofTLST(the last non-zero time). Only profiles carrying trailing zero or BLQ samples were affected. The error propagated toAUCIFP,AUCIFPD,AUCPEP,AUMCIFP,AUMCPEP,VZFP,CLFP,MRTEVIFPand, for non-extravascular routes,VZP,CLP,MRTIVIFP,VSSP. The automatic path was never affected, so results differed between automatic slope selection andUsePointsfor the same points. Introduced in 0.8.0.Fixed the
UsedPointsindex remapping insNCA.BestSlopeandDetSlopereturn indices into the zero-strippedx1, and a single scalar offset measured atLAMZLLwas used to convert them into indices intox. Every zero removed inside the lambda z window shifted the later indices by one, so the reportedUsedPointsnamed the wrong samples and could even name a zero-concentration sample. As a consequence the documented round trip of feedingattr(, "UsedPoints")fromtblNCAback in asUsePointswas not idempotent. Introduced in 0.8.0.Fixed
TLAGinsNCA. It reported the last zero anywhere in the trailing-zero-stripped profile, so a single embedded BLQ sample occurring after measurable concentrations movedTLAGto that late time; it is now the last zero before the first measurable concentration. This also retires a test ony0[x0 == 0]that failed with “the condition has length > 1” when several records shared time 0.Slopenow returnsNAforR2ADJwhen only two points are fit. The expression divides byn - 2and previously yieldedNaN,+Infor-Infdepending on howR2rounded. The automatic path never fits two points, butUsePointscan request it.Fixed the
UsedPointsreported byBestSlopewhen a sampling time is duplicated. The fitted points were identified by looking the lambda z limits back up withwhich(x == LAMZLL):which(x == LAMZUL); a duplicated time makeswhichreturn two positions,a:bthen silently used only the first and emitted “numerical expression has 2 elements: only the first used”, and the reported points named the wrong samples and were one too many. As with the remapping fix above, the consequence was that feedingUsedPointsback in asUsePointsdid not reproduce the original fit. The index range the fit actually spanned is now carried out of the search directly, solength(UsedPoints)always equalsLAMZNPT. The same time lookup was used to seed the interactiveDetSlopefromsNCA, where a duplicated time made it stop with “the condition has length > 1”.BestSlopeno longer stops with “missing value where TRUE/FALSE needed” when two candidate windows tie. A zero at the start of a window is dropped bylog, so that window fits exactly the same points as the next one and the two rows share bothR2ADJandLAMZNPT; both were selected, the result became a matrix instead of a parameter vector, and the caller's test onLAMZNPTthen failed. Tied rows are the same fit, so the first is taken. Reachable by callingBestSlopedirectly, sincesNCAstrips zeros before calling it.tblNCAnow stops whenUsePointsis not a list, or is a list whose length differs from the number of NCAs. It previously discarded such aUsePointswithout a word and silently fell back to automatic slope selection, reporting a different analysis than the one requested. Subsetting the concentration data without subsettingUsePointsto match is the easy way to land here.Unitno longer stops with “missing values are not allowed in subscripted assignments of data frames” for a concentration unit it does not recognise, nor with “non-character argument” forNA. An unrecognised unit now warns and leaves the volume and clearance conversion factorsNA.Added regression tests ‘tests/Test-UsePoints.R’, ‘tests/Test-TLAG.R’, ‘tests/Test-BestSlope.R’ and ‘tests/Test-PQNCA.R’.
OQNCAgains three Tier A (independent, closed-form) operational test cases. The eight existing cases compare against reference outputs onTheophandIndometh, neither of which contains a trailing or an embedded BLQ sample and neither of which exercisesUsePoints, so none of the foursNCA/Slopedefects above was detectable: a build carrying all of them still reported QUALIFIED. The new cases run a synthetic single-subject fixture whose terminal phase is exactly mono-exponential, so lambda z, the half-life andClast_predare known in closed form and the AUCs reduce to a hand-summable trapezoid. The fixture carries a lag-phase zero, an embedded BLQ inside the lambda z window and trailing BLQ, and the three cases cover automatic slope selection, an explicitUsePointsfit, and a round trip that feeds the reportedUsedPointsback in and requires every parameter to be unchanged. The reference table also includesClast_pred, which none of the eight reference files carried, soCLSTPwas previously dropped from the comparison by name mapping and never checked at all.PQNCAno longer truncates profile identifiers in its report. The PROFILE column was a fixed 14 characters wide (12 in the expected-value table and the failed-check list) and the identifier was cut to fit, so a multi-columnkeyrendered as “DA-4505/01-S” for every subject - identical text for profiles that are not the same, in a document whose purpose is to record which profile was checked. The column is now sized to the longest identifier present, and where even that will not fit on a line the row is split instead of cut. A single-column key is laid out exactly as before. Key values are also formatted to 7 significant digits when they are numeric, instead of the up-to-15 thatas.characteremits, which is what made the identifiers unmanageably long; matching still uses the exact value.Fixed the expected-value comparison in
PQNCA. A parameter that wasNAon both sides - not estimable for that profile, and not expected to be - was counted as a difference, because the comparator computed a relative difference and then required it to be non-NA. Supplyingexpectedtherefore produced “expected-values DIFFER” and an overall NOT QUALIFIED for a correct analysis whenever any profile lacked a terminal phase, which is routine in real data. The reproducibility check in the same function already treatedNA/NAas equal, so the two comparators inside one report disagreed with each other. BothNAnow counts as agreement; one sideNAand the other a number is still a difference.The
PQNCAreport now states what its reproducibility check does and does not establish. Re-running the analysis on the same data shows only that the analysis is deterministic; a deterministic error reproduces exactly, so the check cannot detect a wrong answer, and the report no longer leaves that to be inferred.OQNCAtest cases may now supply an inlinedataframe instead of naming a datasets object, and may setroundTrip=TRUEto re-run the analysis with theUsedPointsthe first run reported.
Changes in version 0.8.2 (2026-07-20)
Single-point robustness:
AUCandLogAUCno longer error on a length-1 input (they return 0), sosNCAhandles a subject with a single measurable (non-zero) concentration instead of stopping with "subscript out of bounds".sNCAno longer invokes the interactiveDetSlopewhen there is only one non-zero point (a terminal slope cannot be fit from a single point).
Changes in version 0.8.1 (2026-06-20)
IQNCAadded: a self-contained Installation Qualification (IQ) report in pdf documenting whether NonCompart is correctly installed, intact, loadable, and operational (environment, version, dependency satisfaction, MD5 file integrity, namespace/exports, a functional NCA check against an external reference, an overall QUALIFIED/NOT QUALIFIED verdict, a sessionInfo appendix, and a per-file md5 checksum appendix).OQNCAadded: a self-contained Operational Qualification (OQ) report in pdf. It runs eight WinNonlin-referenced NCA scenarios (shipped in ‘inst/OQ’) throughtblNCAon the user's machine and lists every computed value next to its reference value, with the absolute and relative difference and a pass flag, and an overall verdict.writeMD5NCAadded: writes the standard R ‘MD5’ integrity manifest into an installed package directory (usingtools::md5sum) so that theIQNCAfile-integrity check reports PASS for local installs. CRAN installs already include this manifest.PQNCAadded: a Performance Qualification (PQ) report generator. It runs the analysis the user intends on the user's own data and checks reproducibility, per-profile scientific plausibility, and (optionally) agreement with the user's expected values, with an input-data md5 fingerprint and a signed record.addSigFieldNCAadded (and asigFieldargument toIQNCA/OQNCA/PQNCA): insert Adobe Acrobat Reader signature fields into the report PDF (pure base-R PDF incremental update, no external tools) so it can be signed with one click in the free Acrobat Reader, instead of printing and scanning.signPDFNCAandverifyPDFNCAadded: digitally sign a report PDF (a detached SHA-256 signature written to ‘<pdf>.sig’, using the openssl package) and verify it, as a scriptable alternative.The IQ and OQ reports use 1 inch margins on every side, select Letter paper in a United States locale and A4 elsewhere, and place the signature/approval page first.
Changes in version 0.8.0 (2026-04-26)
sNCA and tblNCA support predetermined indices of points (UsePoints) to calculate terminal slope.
Changes in version 0.7.2 (2026-03-27)
tblNCA supports vector input for dur argument.
Changes in version 0.7.1 (2026-03-09)
Fixed a bug in
Slopewhere sequentialis.finitefiltering could cause misaligned x and y vectors.Fixed typo 'umul/mL' to 'umol/mL' in concentration unit normalization (
Unit,UnitUrine).Replaced unsafe
eval(parse(text=...))with direct logical subsetting intblNCAandtblAUC.Extracted duplicated slope-finding logic in
BestSlopeinto helper functionfindBestSlope.Normalized
admparameter once at the top ofsNCAinstead of callingtoupper(trimws())repeatedly.Extracted shared unit conversion helpers (
normalizeConcUnit,convertVolUnit) inUnit.R.Reduced redundant
toupper(trimws(down))calls inAUCandIntAUC.
Changes in version 0.7.0 (2023-11-15)
Minor updates.
Changes in version 0.6.0 (2022-07-15)
SS option for steady-state added in sNCA and tblNCA
tblAUC, gAUC, gInterpol functions are added for general purpose AUC such as AUC for pharmacodynamic(PD) data.
Changes in version 0.5.1 (2022-06-15)
Rare cases raising NaN in
BestSlopeare handled.
Changes in version 0.5.0 (2022-01-20)
DetSlopeno longer opens a new device when closed.Data type error with tibble data is fixed.
Changes in version 0.4.9 (2021-07-10)
Bug when a slope is determined by manual selection is fixed.
excludeDeltaoption added to tblNCA, sNCA, and BestSlope functions.
Changes in version 0.4.8 (2021-06-10)
UT function removed
returnNA option in sNCA function is removed.
Changes in version 0.4.7 (2020-01-02)
When it is impossible to determine slope, it skips.
Changes in version 0.4.6 (2020-01-02)
tblNCA supports iAUC argument.
Changes in version 0.4.5 (2019-09-28)
Some sentences are revised.
Changes in version 0.4.4 (2018-07-20)
Nonnumeric Subject ID is supported.
Changes in version 0.4.3 (2018-05-17)
tblNCAis rewritten.
Changes in version 0.4.2 (2018-05-17)
Issue on reverse dependence on
ncaris solved.
Changes in version 0.4.1 (2018-04-17)
Validation document is added.
DetSlopenow accepts default slope fromBestSlope.Errata in manual corrected.
Changes in version 0.4.0 (2018-03-17)
DetSlopefunction is added to determine slope manually.
Changes in version 0.3.3 (2017-08-16)
NonCompart is more tolerable to the input error.
sNCAcan accept key of multiple columns instead of single column colSubj.
Changes in version 0.3.2 (2017-07-19)
NonCompart can handle the case of no or one positive y value.
Changes in version 0.3.1 (2017-07-10)
NonCompart A bug in C0 calcuation of IV bolus case was fixed.
Changes in version 0.3.0 (2017-04-06)
NonCompart Only essential functions for calculation were remained.