| NEWS | R Documentation |
News for Package NonCompart
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 WinNonlin 6.4 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 no WinNonlin reference file 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.