| Title: | Noncompartmental Analysis for Pharmacokinetic Data |
|---|---|
| Description: | Conduct a noncompartmental analysis with industrial strength. Some features are 1) Use of CDISC SDTM terms 2) Automatic or manual slope selection 3) Supporting both 'linear-up linear-down' and 'linear-up log-down' method 4) Interval(partial) AUCs with 'linear' or 'log' interpolation method 5) Installation/Operational Qualification (IQ/OQ) reports in pdf. After installation, qualify the package in your own environment: run IQNCA() for Installation Qualification and OQNCA() for Operational Qualification. Run writeMD5NCA() once after installation so the IQ file-integrity check passes. To approve a report, sign it digitally in Adobe Acrobat Reader (generate with sigField=TRUE, or run addSigFieldNCA(), to add click-to-sign fields), instead of printing and scanning; or use signPDFNCA()/verifyPDFNCA() for a scriptable signature. * Reference: Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016. (ISBN:9198299107). |
| Authors: | Kyun-Seop Bae [aut, cre] |
| Maintainer: | Kyun-Seop Bae <[email protected]> |
| License: | GPL-3 |
| Version: | 0.8.2 |
| Built: | 2026-07-20 08:34:21 UTC |
| Source: | https://github.com/cran/NonCompart |
It conducts a noncompartmental analysis(NCA) with industrial strength.
The main functions are
tblNCA to perform NCA for many subjects. sNCA to perform NCA for one subject.
Kyun-Seop Bae <[email protected]>
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011.
Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
# Theoph and Indometh data: dose in mg, conc in mg/L, time in h tblNCA(Theoph, key="Subject", colTime="Time", colConc="conc", dose=320, adm="Extravascular", doseUnit="mg", concUnit="mg/L") tblNCA(Indometh, key="Subject", colTime="time", colConc="conc", dose=25, adm="Infusion", dur=0.5, doseUnit="mg", concUnit="mg/L", R2ADJ=0.9) # For individual NCA iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) ; iAUC x = Theoph[Theoph$Subject=="1","Time"] y = Theoph[Theoph$Subject=="1","conc"] sNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h", iAUC=iAUC) sNCA(x, y, dose=320, concUnit="mg/L", iAUC=iAUC)# Theoph and Indometh data: dose in mg, conc in mg/L, time in h tblNCA(Theoph, key="Subject", colTime="Time", colConc="conc", dose=320, adm="Extravascular", doseUnit="mg", concUnit="mg/L") tblNCA(Indometh, key="Subject", colTime="time", colConc="conc", dose=25, adm="Infusion", dur=0.5, doseUnit="mg", concUnit="mg/L", R2ADJ=0.9) # For individual NCA iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) ; iAUC x = Theoph[Theoph$Subject=="1","Time"] y = Theoph[Theoph$Subject=="1","conc"] sNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h", iAUC=iAUC) sNCA(x, y, dose=320, concUnit="mg/L", iAUC=iAUC)
Insert empty digital-signature form fields (AcroForm /Sig fields) into a PDF
so it can be signed in Adobe Acrobat Reader (the free reader) with one click: open
the PDF, click a field, and sign with a Digital ID. The field is added with a
pure base-R PDF incremental update, with no external tools or packages, so it works
wherever R does. It is designed for the simple PDFs produced by IQNCA
and OQNCA.
Acrobat Reader can also sign a PDF that has no field at all (“All tools” > “Use a certificate” > “Digitally sign”, then drag a rectangle). This function only makes the workflow click-to-sign by pre-placing labelled fields.
addSigFieldNCA(pdf, out = pdf, page = 1L, fieldNames = c("Performed_by", "Reviewed_by"), rects = NULL)addSigFieldNCA(pdf, out = pdf, page = 1L, fieldNames = c("Performed_by", "Reviewed_by"), rects = NULL)
pdf |
path to the input PDF. |
out |
path to write the result; defaults to overwriting |
page |
1-based page number to place the field(s) on (the signature page is
page 1 of |
fieldNames |
character vector of field names; one signature field is added per name. The names appear in Acrobat's Signature panel. |
rects |
optional list of numeric length-4 rectangles |
The function appends an incremental-update section that adds an /AcroForm to
the document catalog (with /SigFlags 3), one /Widget signature
annotation per field, and the field references to the page's /Annots. The
original content is left untouched. The resulting fields are unsigned; the actual
cryptographic signature is applied by Acrobat Reader using the signer's Digital ID.
Only classic cross-reference-table PDFs are supported (those written by R's
pdf device); the function stops on cross-reference-stream
PDFs.
Invisibly, the output path. A PDF with signature fields is written as a side effect.
Kyun-Seop Bae <[email protected]>
#IQNCA("NonCompart-IQ-Report.pdf", performedBy = "Kyun-Seop Bae") #addSigFieldNCA("NonCompart-IQ-Report.pdf") # adds Performed_by / Reviewed_by fields ## or in one step: #IQNCA("NonCompart-IQ-Report.pdf", performedBy = "Kyun-Seop Bae", sigField = TRUE) ## then open in Acrobat Reader and click each field to sign with your Digital ID.#IQNCA("NonCompart-IQ-Report.pdf", performedBy = "Kyun-Seop Bae") #addSigFieldNCA("NonCompart-IQ-Report.pdf") # adds Performed_by / Reviewed_by fields ## or in one step: #IQNCA("NonCompart-IQ-Report.pdf", performedBy = "Kyun-Seop Bae", sigField = TRUE) ## then open in Acrobat Reader and click each field to sign with your Digital ID.
Calculate Area Under the Curve(AUC) and the first Moment Curve(AUMC) in two ways; 'linear trapezoidal method' or 'linear-up and log-down' method. Return a table of cumulative values.
AUC(x, y, down = "Linear")AUC(x, y, down = "Linear")
x |
vector values of independent variable, usually time |
y |
vector values of dependent variable, usually concentration |
down |
either of |
down="Linear" means linear trapezoidal rule with linear interpolation.
down="Log" means linear-up and log-down method.
Table with two columns, AUC and AUMC; the first column values are cumulative AUCs and the second column values cumulative AUMCs.
Kyun-Seop Bae <[email protected]>
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. pp687-689. 2011.
AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], down="Log")AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], down="Log")
It sequentially fits (log(y) ~ x) from the last point of x to the previous points with at least 3 points. It chooses a slope the highest adjusted R-square. If the difference is less then 1e-4, it pickes longer slope.
BestSlope(x, y, adm = "Extravascular", TOL=1e-4, excludeDelta = 1)BestSlope(x, y, adm = "Extravascular", TOL=1e-4, excludeDelta = 1)
x |
vector values of x-axis, usually time |
y |
vector values of y-axis, usually concentration |
adm |
one of |
TOL |
tolerance. See Phoenix WinNonlin 6.4 User's Guide p33 for the detail. |
excludeDelta |
Improvement of R2ADJ larger than this value could exclude the last point. Default value 1 is for the compatibility with other software. |
Choosing the best terminal slope (y in log scale) in pharmacokinetic analysis is somewhat challenging, and it could vary by analysis performer.
Phoenix WinNonlin chooses a slope with highest adjusted R-squared and the longest one. The difference of adjusted R-Squared less than TOL considered to be 0.
This function uses ordinary least square method (OLS). Author recommends to use excludeDelta option with about 0.3.
R2 |
R-squared |
R2ADJ |
adjusted R-squared |
LAMZNPT |
number of points used for slope |
LAMZ |
negative of the slope, lambda_z |
b0 |
intercept of the regression line |
CORRXY |
correlation of log(y) and x |
LAMZLL |
earliest x for lambda_z |
LAMZUL |
last x for lambda_z |
CLSTP |
predicted y value at the last point, predicted concentration for the last time point |
Kyun-Seop Bae <[email protected]>
BestSlope(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) BestSlope(Indometh[Indometh$Subject==1, "time"], Indometh[Indometh$Subject==1, "conc"], adm="Bolus")BestSlope(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) BestSlope(Indometh[Indometh$Subject==1, "time"], Indometh[Indometh$Subject==1, "conc"], adm="Bolus")
You choose a slope for terminal half-life.
DetSlope(x, y, SubTitle="", sel.1=0, sel.2=0)DetSlope(x, y, SubTitle="", sel.1=0, sel.2=0)
x |
vector values of x-axis, usually time |
y |
vector values of y-axis, usually concentration |
SubTitle |
subtitle to be shown on the plot |
sel.1 |
default index of the first element to use |
sel.2 |
default index of the last element to use |
Sometimes BestSlope cannot find terminal slope satisfactorily. Then you can use this function to choose manually. It returns the same format result with BestSlope with an attribute indicating used points.
R2 |
R-squared |
R2ADJ |
adjusted R-squared |
LAMZNPT |
number of points used for the slope |
LAMZ |
negative of the slope, lambda_z |
b0 |
intercept of the regression line |
CORRXY |
correlation of log(y) and x |
LAMZLL |
earliest x for lambda_z |
LAMZUL |
last x for lambda_z |
CLSTP |
predicted y value at the last point, predicted concentration for the last time point |
Kyun-Seop Bae <[email protected]>
DetSlope(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) DetSlope(Indometh[Indometh$Subject==2, "time"], Indometh[Indometh$Subject==2, "conc"])DetSlope(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) DetSlope(Indometh[Indometh$Subject==2, "time"], Indometh[Indometh$Subject==2, "conc"])
General AUC function for Emax, TEmax and AUCs
gAUC(x, y, Ymax = "Emax", XofYmax = "TEmax", AUCname = "AUEClast", iAUC = "", Outer = "NEAREST")gAUC(x, y, Ymax = "Emax", XofYmax = "TEmax", AUCname = "AUEClast", iAUC = "", Outer = "NEAREST")
x |
usually time |
y |
usually concentration or effect. This can be negative/ |
Ymax |
usually Cmax or Emax |
XofYmax |
usually Tmax or TEmax |
AUCname |
usually AUClast or AUEClast |
iAUC |
a data.frame to calculate interval AUCs |
Outer |
indicates how to do the out of x range point |
This is a general purpose AUC function. It calculates only Cmax(Emax), Tmax(TEmax) and AUCs(AUECs). This can be used for effect(pharmacodynamic) data which has negative values. For concentration data, use IntAUC.
Column names can vary according to the options.
Emax |
maximum y value |
TEmax |
x value at the maximum y value |
AUEClast |
Area under the y versus x curve |
iAUCs |
Columns from iAUC input |
Kyun-Seop Bae <[email protected]>
# For one subject x = Theoph[Theoph$Subject=="1", "Time"] y = Theoph[Theoph$Subject=="1", "conc"] gAUC(x, y) iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) gAUC(x, y, iAUC=iAUC)# For one subject x = Theoph[Theoph$Subject=="1", "Time"] y = Theoph[Theoph$Subject=="1", "conc"] gAUC(x, y) iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) gAUC(x, y, iAUC=iAUC)
It calculates interval AUC of general form. This is useful for pharmacodynamic data.
gIntAUC(x, y, t1, t2, Outer = "NEAREST")gIntAUC(x, y, t1, t2, Outer = "NEAREST")
x |
vector values of independent variable, usually time |
y |
vector values of dependent variable, usually concentration |
t1 |
start time for AUC |
t2 |
end time for AUC |
Outer |
indicates how to do the out of x range point |
This calculates an interval (partial) AUC (from t1 to t2) with the given series of x and y.
If t1 and/or t2 cannot be found within x vector, it interpolates.
If t1 and/or t2 are out of x range, it uses the nearest value.
For concentration data, use IntAUC.
return interval AUC value (scalar)
Kyun-Seop Bae <[email protected]>
gIntAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], t1=0.5, t2=11)gIntAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], t1=0.5, t2=11)
It interpolates y value when a corresponding x value (xnew) does not exist within x vector
gInterpol(x, y, xnew, Outer="NEAREST")gInterpol(x, y, xnew, Outer="NEAREST")
x |
vector values of x-axis, usually time |
y |
vector values of y-axis, usually concentration |
xnew |
new x point to be interpolated, usually new time point |
Outer |
indicates how to do the out of x range point |
This function interpolate y value, if xnew is not in x vector.
If xnew is in the x vector, it just returns the given x and y vector.
This function usually is called by gIntAUC function.
Returned vector is sorted in the order of increasing x values.
new x and y vector containing xnew and ynew point
Kyun-Seop Bae <[email protected]>
x = 1:10 + 0.1 y = -2*x + 40.2 gInterpol(x, y, 1.5) gInterpol(x, y, 0.5) # Out of range, Left gInterpol(x, y, 11) # Out of range, Rightx = 1:10 + 0.1 y = -2*x + 40.2 gInterpol(x, y, 1.5) gInterpol(x, y, 0.5) # Out of range, Left gInterpol(x, y, 11) # Out of range, Right
It calculates interval AUC
IntAUC(x, y, t1, t2, Res, down = "Linear")IntAUC(x, y, t1, t2, Res, down = "Linear")
x |
vector values of independent variable, usually time |
y |
vector values of dependent variable, usually concentration |
t1 |
start time for AUC |
t2 |
end time for AUC |
Res |
result from |
down |
either of |
This calculates an interval (partial) AUC (from t1 to t2) with the given series of x and y.
If t1 and/or t2 cannot be found within x vector, it interpolates according to the down option.
return interval AUC value (scalar)
Kyun-Seop Bae <[email protected]>
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011.
Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
Res = sNCA(Theoph[Theoph$Subject==1,"Time"], Theoph[Theoph$Subject==1, "conc"], dose=320, concUnit="mg/L") IntAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], t1=0.5, t2=11, Res)Res = sNCA(Theoph[Theoph$Subject==1,"Time"], Theoph[Theoph$Subject==1, "conc"], dose=320, concUnit="mg/L") IntAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], t1=0.5, t2=11, Res)
It interpolates y value when a corresponding x value (xnew) does not exist within x vector
Interpol(x, y, xnew, Slope, b0, down = "Linear")Interpol(x, y, xnew, Slope, b0, down = "Linear")
x |
vector values of x-axis, usually time |
y |
vector values of y-axis, usually concentration |
xnew |
new x point to be interpolated, usually new time point |
Slope |
slope of regression log(y) ~ x |
b0 |
y value of just left point of xnew |
down |
either of |
This function interpolate y value, if xnew is not in x vector.
If xnew is in x vector, it just returns the given x and y vector.
This function usually is called by IntAUC function.
Returned vector is sorted in the order of increasing x values.
new x and y vector containing xnew and ynew point
Kyun-Seop Bae <[email protected]>
x = 10:1 + 0.1 y = -2*x + 40.2 Interpol(x, y, 1.5) Interpol(x, y, 1.5, down="Log")x = 10:1 + 0.1 y = -2*x + 40.2 Interpol(x, y, 1.5) Interpol(x, y, 1.5, down="Log")
Generate a self-contained PDF report documenting whether the NonCompart package is correctly installed, intact, loadable, and operational in the user's own R environment. It is intended as Installation Qualification (IQ) evidence, in the spirit of the WinNonlin validation suite. The report uses only base R and the package's own pdf helpers, so it requires no LaTeX, pandoc, or other external tools. The signature (approval) page is placed first and the report uses 1 inch margins on every side, with Letter paper in a United States locale and A4 elsewhere.
IQNCA(fileName = "NonCompart-IQ-Report.pdf", pkgs = "NonCompart", functional = TRUE, performedBy = "", paper = "auto", sigField = FALSE)IQNCA(fileName = "NonCompart-IQ-Report.pdf", pkgs = "NonCompart", functional = TRUE, performedBy = "", paper = "auto", sigField = FALSE)
fileName |
file name to save the PDF report. |
pkgs |
character vector of package names to qualify; defaults to
|
functional |
if |
performedBy |
name of the person performing the qualification, printed on the signature page. Defaults to the login name. |
paper |
paper size: |
sigField |
if |
The report contains: the test environment (R version, platform, OS, locale, library
paths); the installed package version, location and declared-dependency satisfaction;
file integrity via checkMD5sums (PASS / FAIL / WARN when no
manifest is present - see writeMD5NCA); namespace load and core exports;
an optional functional verification; an overall QUALIFIED / NOT QUALIFIED verdict; a
sessionInfo appendix; and a per-file md5 checksum appendix.
Invisibly, a list with fileName, qualified, paper, checks
(a data frame of every check), and the counts nPass, nFail,
nWarn. A PDF file is written to fileName.
Kyun-Seop Bae <[email protected]>
OQNCA, writeMD5NCA, sNCA, tblNCA
#IQNCA() #res <- IQNCA(performedBy = "Jane Doe"); res$qualified#IQNCA() #res <- IQNCA(performedBy = "Jane Doe"); res$qualified
It calculates AUC and AUMC using the linear trapezoidal method
LinAUC(x, y)LinAUC(x, y)
x |
vector values of the independent variable, usually time |
y |
vector values of the dependent variable, usually concentration |
This function returns AUC and AUMC by the linear trapezoidal method.
AUC |
area under the curve |
AUMC |
area under the first moment curve |
Kyun-Seop Bae <[email protected]>
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011.
Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
LinAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) # compare the last lineLinAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) # compare the last line
It calculates AUC and AUMC using the linear-up log-down method
LogAUC(x, y)LogAUC(x, y)
x |
vector values of the independent variable, usually time |
y |
vector values of the dependent variable, usually concentration |
This function returns AUC and AUMC by the linear-up log-down method.
AUC |
area under the curve |
AUMC |
area under the first moment curve |
Kyun-Seop Bae <[email protected]>
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011.
Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
LogAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) # Compare the last line with the above AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], down="Log")LogAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) # Compare the last line with the above AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], down="Log")
Generate a self-contained PDF report that documents whether the NonCompart noncompartmental analysis engine reproduces pre-specified reference results on the user's own machine, within a pre-specified relative tolerance. It is intended as Operational Qualification (OQ) evidence, in the spirit of the WinNonlin computational-engine verification. The report lists every computed value next to its reference value, with the absolute and relative difference and a pass flag, then an overall verdict. It uses only base R and the package's pdf helpers (no LaTeX). The signature page is first; 1 inch margins; Letter paper in a United States locale and A4 elsewhere.
OQNCA(fileName = "NonCompart-OQ-Report.pdf", cases = NULL, tol = 0.001, refDir = system.file("OQ", package = "NonCompart"), performedBy = "", paper = "auto", sigField = FALSE)OQNCA(fileName = "NonCompart-OQ-Report.pdf", cases = NULL, tol = 0.001, refDir = system.file("OQ", package = "NonCompart"), performedBy = "", paper = "auto", sigField = FALSE)
fileName |
file name to save the PDF report. |
cases |
a list of OQ case definitions. If |
tol |
acceptance tolerance: a parameter passes when the symmetric relative
difference |
refDir |
directory holding the reference csv files and the ‘RptCfg.csv’
PPTESTCD-to-WinNonlin name map. Defaults to the |
performedBy |
name of the person performing the qualification, printed on the signature page. Defaults to the login name. |
paper |
paper size: |
sigField |
if |
For each case the function runs tblNCA on the (frozen) input data, maps
the CDISC PPTESTCD result columns to WinNonlin parameter names using
‘RptCfg.csv’ in refDir, matches comparable parameters to the reference
table (robust to % vs . naming), and compares every parameter for
every subject. A case passes only when all of its comparisons pass.
The bundled reference values are WinNonlin 6.4 NCA outputs. These establish concordance with the de-facto reference implementation (Tier B); they are not, by themselves, an independent verification.
Invisibly, a list with fileName, qualified, tol, nCases,
nFailCases, paper, and results (a per-case list whose
comp element is the full table of every comparison). A PDF is written to
fileName.
Kyun-Seop Bae <[email protected]>
#OQNCA() #res <- OQNCA(); res$qualified; res$results[[1]]$comp#OQNCA() #res <- OQNCA(); res$qualified; res$results[[1]]$comp
Generate a self-contained PDF report documenting a Performance Qualification (PQ)
of noncompartmental analysis for the user's own data and intended workflow. Whereas
OQNCA compares the engine to fixed reference values, PQ runs the
analysis the user actually intends to run, on the user's (or representative) data,
and checks that the result is reproducible, scientifically plausible, and
(optionally) matches the user's pre-specified expected values, with a documented,
signed record including a fingerprint (md5) of the input data. The report uses the
package's own pdf helpers (no LaTeX) and the signature/approval page is placed first.
PQNCA(fileName = "NonCompart-PQ-Report.pdf", concData, key = "Subject", colTime = "Time", colConc = "conc", ..., expected = NULL, acceptance = NULL, performedBy = "", paper = "auto", sigField = FALSE)PQNCA(fileName = "NonCompart-PQ-Report.pdf", concData, key = "Subject", colTime = "Time", colConc = "conc", ..., expected = NULL, acceptance = NULL, performedBy = "", paper = "auto", sigField = FALSE)
fileName |
file name to save the PDF report. |
concData |
the user's concentration data set (data frame) to qualify. |
key |
column name(s) identifying each profile. |
colTime |
column name for time. |
colConc |
column name for concentration. |
... |
further arguments passed to |
expected |
optional data frame of the user's pre-specified expected parameter
values (a |
acceptance |
a list of PQ acceptance criteria; if |
performedBy |
name of the person performing the qualification, printed on the signature page. Defaults to the login name. |
paper |
paper size: |
sigField |
if |
The report contains: the intended-use inputs and the input-data md5 fingerprint; the
PQ acceptance criteria; a reproducibility check (the analysis is re-run on the same
data and must reproduce identical results); per-profile performance/plausibility
checks (Cmax > 0, Cmax >= Clast, Tmax within the observed time range, AUClast > 0,
and for profiles with a terminal slope: AUCINF_obs >= AUClast, AUC %Extrap within
limit, adjusted R-squared above limit, half-life positive and finite); an optional
comparison to user-supplied expected values; an overall QUALIFIED / NOT QUALIFIED
verdict; and a sessionInfo appendix.
PQ acceptance criteria and the choice of representative data are the user's responsibility; this function provides the tool and configurable defaults.
Invisibly, a list with fileName, qualified, paper,
results (the tblNCA table), reproducible, profiles
(per-profile checks), fingerprint, nProfFail, nNonEval, and
expected. A PDF is written to fileName.
Kyun-Seop Bae <[email protected]>
#Theoph2 <- as.data.frame(Theoph); Theoph2$Subject <- as.numeric(as.character(Theoph2$Subject)) #PQNCA("MyStudy-PQ.pdf", Theoph2, "Subject", "Time", "conc", dose = 320, # concUnit = "mg/L", performedBy = "Kyun-Seop Bae", sigField = TRUE)#Theoph2 <- as.data.frame(Theoph); Theoph2$Subject <- as.numeric(as.character(Theoph2$Subject)) #PQNCA("MyStudy-PQ.pdf", Theoph2, "Subject", "Time", "conc", dose = 320, # concUnit = "mg/L", performedBy = "Kyun-Seop Bae", sigField = TRUE)
Apply a cryptographic digital signature to a (report) PDF, as an alternative to the
print-sign-scan workflow, and verify it. signPDFNCA signs the PDF bytes with the
signer's private key (RSA or EC) using SHA-256 and writes a detached signature
sidecar ‘<pdf>.sig’ (and, by default, the signer's public key
‘<pdf>.pubkey.pem’). verifyPDFNCA confirms, with the signer's public
key or certificate, that the PDF is byte-for-byte intact and was signed by that key
(tamper-evidence and non-repudiation). These functions require the openssl
package.
This is a detached signature (a separate ‘.sig’ file), not a PAdES signature embedded inside the PDF; embedding a visible in-viewer signature requires a dedicated PDF tool (e.g. Adobe Acrobat or ‘pyhanko’). The detached signature is cryptographically equivalent for integrity and non-repudiation.
signPDFNCA(pdf, key, password = NULL, signer = "", role = "", sigFile = paste0(pdf, ".sig"), writePubkey = TRUE) verifyPDFNCA(pdf, sigFile = paste0(pdf, ".sig"), pubkey = paste0(pdf, ".pubkey.pem"))signPDFNCA(pdf, key, password = NULL, signer = "", role = "", sigFile = paste0(pdf, ".sig"), writePubkey = TRUE) verifyPDFNCA(pdf, sigFile = paste0(pdf, ".sig"), pubkey = paste0(pdf, ".pubkey.pem"))
pdf |
path to the PDF file to sign or verify. |
key |
the signer's private key: a path to a PEM key file or an openssl
key object. Create one once with, e.g., |
password |
password for an encrypted private key, or |
signer |
name of the signer, recorded in the signature sidecar. Defaults to the login name. |
role |
optional role recorded in the sidecar, e.g. |
sigFile |
path of the signature sidecar to write ( |
writePubkey |
if |
pubkey |
the signer's public key or certificate used to verify: a PEM path (public key or X.509 certificate) or an openssl pubkey/cert object. |
signPDFNCA invisibly returns a list with the sidecar path, the PDF sha256,
the signer, and the public-key fingerprint; it writes the ‘.sig’ sidecar
as a side effect. verifyPDFNCA invisibly returns TRUE only if both the
signature is valid and the recorded hash matches, and prints a human-readable result.
Kyun-Seop Bae <[email protected]>
#key <- openssl::rsa_keygen() #openssl::write_pem(key, "signer_key.pem") #IQNCA("NonCompart-IQ-Report.pdf", performedBy = "Kyun-Seop Bae") #signPDFNCA("NonCompart-IQ-Report.pdf", "signer_key.pem", signer = "Kyun-Seop Bae") #verifyPDFNCA("NonCompart-IQ-Report.pdf")#key <- openssl::rsa_keygen() #openssl::write_pem(key, "signer_key.pem") #IQNCA("NonCompart-IQ-Report.pdf", performedBy = "Kyun-Seop Bae") #signPDFNCA("NonCompart-IQ-Report.pdf", "signer_key.pem", signer = "Kyun-Seop Bae") #verifyPDFNCA("NonCompart-IQ-Report.pdf")
It calculates the slope with linear regression of log(y) ~ x
Slope(x, y)Slope(x, y)
x |
vector values of the independent variable, usually time |
y |
vector values of the dependent variable, usually concentration |
With time-concentration curve, you frequently need to estimate slope in log(concentration) ~ time.
This function is usually called by BestSlope function, and you seldom need to call this function directly.
R2 |
R-squared |
R2ADJ |
adjusted R-squared |
LAMZNPT |
number of points used for slope |
LAMZ |
negative of the slope, lambda_z |
b0 |
intercept of the regression line |
CORRXY |
correlation of log(y) and x |
LAMZLL |
earliest x for lambda_z |
LAMZUL |
last x for lambda_z |
Kyun-Seop Bae <[email protected]>
Slope(Indometh[Indometh$Subject==1, "time"], Indometh[Indometh$Subject==1, "conc"])Slope(Indometh[Indometh$Subject==1, "time"], Indometh[Indometh$Subject==1, "conc"])
This is the work-horse function for NCA.
sNCA(x, y, dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg", timeUnit = "h", concUnit = "ug/L", iAUC = "", down = "Linear", R2ADJ = 0.7, MW = 0, SS = FALSE, Keystring="", excludeDelta = 1, UsePoints = NULL)sNCA(x, y, dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg", timeUnit = "h", concUnit = "ug/L", iAUC = "", down = "Linear", R2ADJ = 0.7, MW = 0, SS = FALSE, Keystring="", excludeDelta = 1, UsePoints = NULL)
x |
usually time, a vector |
y |
usually concentration, a vector |
dose |
given amount, not amount per body weight, a scalar |
adm |
one of |
dur |
duration of infusion, a scalar |
doseUnit |
unit of dose |
timeUnit |
unit of time |
concUnit |
unit of concentration |
iAUC |
interval AUCs to calculate |
down |
either of |
R2ADJ |
Minimum adjusted R-square value to determine terminal slope automatically |
MW |
molecular weight of the drug |
SS |
if steady-state, this should be TRUE. AUCLST (AUClast) is used instead of AUCIFO (AUCinf) for the calculation of Vz (VZFO, VZO), CL (CLFO, CLO), and Vdss (VSSO). |
Keystring |
a text string to be shown at the plot in case of manual selection of terminal slope |
excludeDelta |
Improvement of R2ADJ larger than this value could exclude the last point. Default value 1 is for the compatibility with other software. |
UsePoints |
Indices of points to calculate terminal slope. Vaules of use points should not be zero. Use only when automatic determination is not satisfactory. If this is used, R2ADJ option is ignored. |
This replaced previous IndiNCA. Author recommends to use excludeDelta option with about 0.3.
CMAX |
maximum concentration, Cmax |
CMAXD |
dose normalized Cmax, CMAX / Dose, Cmax / Dose |
TMAX |
time of maximum concentration, Tmax |
TLAG |
time to observe the first non-zero concentration, for extravascular administration only |
CLST |
last positive concentration observed, Clast |
CLSTP |
last positive concentration predicted, Clast_pred |
TLST |
time of last positive concentration, Tlast |
LAMZHL |
half-life by lambda z, ln(2)/LAMZ |
LAMZ |
lambda_z negative of the best-fit terminal slope |
LAMZLL |
earliest time for LAMZ |
LAMZUL |
last time for LAMZ |
LAMZNPT |
number of points for LAMZ |
CORRXY |
correlation of log(concentration) and time |
R2 |
R-squared |
R2ADJ |
R-squared adjusted |
C0 |
back extrapolated concentration at time 0, for intravascular bolus administration only |
AUCLST |
AUC from 0 to TLST |
AUCALL |
AUC using all the given points, including trailing zero concentrations |
AUCIFO |
AUC infinity observed |
AUCIFOD |
AUCIFO / Dose |
AUCIFP |
AUC infinity predicted using CLSTP instead of CLST |
AUCIFPD |
AUCIFP / Dose |
AUCPEO |
AUC % extrapolation observed |
AUCPEP |
AUC % extrapolated for AUCIFP |
AUCPBEO |
AUC % back extrapolation observed, for bolus IV administration only |
AUCPBEP |
AUC % back extrapolation predicted with AUCIFP, for bolus IV administration only |
AUMCLST |
AUMC to the TLST |
AUMCIFO |
AUMC infinity observed using CLST |
AUMCIFP |
AUMC infinity determined by CLSTP |
AUMCPEO |
AUMC % extrapolated observed |
AUMCPEP |
AUMC % extrapolated predicted |
MRTIVLST |
mean residence time (MRT) to TLST, for intravascular administration |
MRTIVIFO |
mean residence time (MRT) infinity using CLST, for intravascular administration |
MRTIVIFP |
mean residence time (MRT) infinity using CLSTP, for intravascular administration |
MRTEVLST |
mean residence time (MRT) to TLST, for extravascular administration |
MRTEVIFO |
mean residence time (MRT) infinity using CLST, for extravascular administration |
MRTEVIFP |
mean residence time (MRT) infinity using CLSTP, for extravascular administration |
VZO |
volume of distribution determined by LAMZ and AUCIFO, for intravascular administration |
VZP |
volume of distribution determined by LAMZ and AUCIFP, for intravascular administration |
VZFO |
VZO for extravascular administration, VZO/F, F is bioavailability |
VZFP |
VZP for extravascular administration, VZP/F, F is bioavailability |
CLO |
clearance using AUCIFO, for intravascular administration |
CLP |
clearance using AUCIFP, for intravascular administration |
CLFO |
CLO for extravascular administration, CLO/F, F is bioavailability |
CLFP |
CLP for extravascular administration, CLP/F, F is bioavailability |
VSSO |
volume of distribution at steady state using CLST, for intravascular administration only |
VSSP |
volume of distribution at steady state using CLSTP, for intravascular administration only |
units |
An attribute to show units |
UsedPoints |
An attribute to show indices of used points |
Kyun-Seop Bae <[email protected]>
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
# For one subject x = Theoph[Theoph$Subject=="1","Time"] y = Theoph[Theoph$Subject=="1","conc"] sNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h") sNCA(x, y, dose=320, concUnit="mg/L") iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) sNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h", iAUC=iAUC) MW = 180.164 # Molecular weight of theophylline sNCA(x, y/MW, dose=320, doseUnit="mg", concUnit="mmol/L", timeUnit="h") sNCA(x, y/MW, dose=320, doseUnit="mg", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y, dose=320/MW, doseUnit="mmol", concUnit="mg/L", timeUnit="h", MW=MW) sNCA(x, y/MW, dose=320/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y/MW, dose=320/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y/MW, dose=as.numeric(NA), doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y, dose=320, concUnit="mg/L", timeUnit="hr") sNCA(x*60, y, dose=320, concUnit="mg/L", timeUnit="min")# For one subject x = Theoph[Theoph$Subject=="1","Time"] y = Theoph[Theoph$Subject=="1","conc"] sNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h") sNCA(x, y, dose=320, concUnit="mg/L") iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) sNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h", iAUC=iAUC) MW = 180.164 # Molecular weight of theophylline sNCA(x, y/MW, dose=320, doseUnit="mg", concUnit="mmol/L", timeUnit="h") sNCA(x, y/MW, dose=320, doseUnit="mg", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y, dose=320/MW, doseUnit="mmol", concUnit="mg/L", timeUnit="h", MW=MW) sNCA(x, y/MW, dose=320/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y/MW, dose=320/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y/MW, dose=as.numeric(NA), doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y, dose=320, concUnit="mg/L", timeUnit="hr") sNCA(x*60, y, dose=320, concUnit="mg/L", timeUnit="min")
Do multiple AUCs and returns a result table. See gAUC for more detail i.e. iAUC
tblAUC(Data, key = "Subject", colX = "Time", colY = "Y", iAUC = "", Ymax = "Emax", XofYmax = "TEmax", AUCname = "AUEClast", Outer = "NEAREST")tblAUC(Data, key = "Subject", colX = "Time", colY = "Y", iAUC = "", Ymax = "Emax", XofYmax = "TEmax", AUCname = "AUEClast", Outer = "NEAREST")
Data |
data table name |
key |
column names of Data to be shown in the output table |
colX |
column name for x axis |
colY |
column name for y axis |
iAUC |
a data.frame to calculate interval AUCs |
Ymax |
usually Cmax or Emax |
XofYmax |
usually Tmax or TEmax |
AUCname |
usually AUClast or AUEClast |
Outer |
indicates how to do the out of x range point |
Tabular output of AUC with many subjects. This calculates only Cmax(Emax), Tmax(TEmax), AUCs
Basically same with gAUC
Kyun-Seop Bae <[email protected]>
tblAUC(Theoph, key="Subject", colX="Time", colY="conc") iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) tblAUC(Indometh, key="Subject", colX="time", colY="conc", iAUC=iAUC)tblAUC(Theoph, key="Subject", colX="Time", colY="conc") iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) tblAUC(Indometh, key="Subject", colX="time", colY="conc", iAUC=iAUC)
Do multiple NCA and returns a result table. See sNCA for more detail i.e. iAUC
tblNCA(concData, key = "Subject", colTime = "Time", colConc = "conc", dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg", timeUnit = "h", concUnit = "ug/L", down = "Linear", R2ADJ = 0, MW = 0, SS = FALSE, iAUC = "", excludeDelta = 1, UsePoints = NULL)tblNCA(concData, key = "Subject", colTime = "Time", colConc = "conc", dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg", timeUnit = "h", concUnit = "ug/L", down = "Linear", R2ADJ = 0, MW = 0, SS = FALSE, iAUC = "", excludeDelta = 1, UsePoints = NULL)
concData |
concentration data table |
key |
column names of concData to be shown in the output table |
colTime |
column name for time |
colConc |
column name for concentration |
dose |
administered dose, a scalar or a vector |
adm |
one of |
dur |
duration of infusion, a scalar or a vector |
doseUnit |
unit of dose |
timeUnit |
unit of time |
concUnit |
unit of concentration |
down |
method to calculate AUC, |
R2ADJ |
Lowest threshold of adjusted R-square value to do manual slope determination |
MW |
molecular weight of drug |
SS |
if steady-state, this should be TRUE. AUCLST (AUClast) is used instead of AUCIFO (AUCinf) for the calculation of Vz (VZFO, VZO), CL (CLFO, CLO), and Vdss (VSSO). |
iAUC |
data.frame for interval AUC |
excludeDelta |
Improvement of R2ADJ larger than this value could exclude the last point. Default value 1 is for the compatibility with other software. |
UsePoints |
A list of length equal to the number of subjects/NCAs. Each element is a vector of indices of points to calculate terminal slope for the corresponding subject. Values of use points should not be zero. Use only when automatic determination is not satisfactory. If this is used, R2ADJ option is ignored. |
Tabular output of NCA with many subjects. Author recommends to use excludeDelta option with about 0.3.
CMAX |
maximum concentration, Cmax |
CMAXD |
dose normalized Cmax, CMAX / Dose, Cmax / Dose |
TMAX |
time of maximum concentration, Tmax |
TLAG |
time to observe the first non-zero concentration, for extravascular administration only |
CLST |
last positive concentration observed, Clast |
CLSTP |
last positive concentration predicted, Clast_pred |
TLST |
time of last positive concentration, Tlast |
LAMZHL |
half-life by lambda z, ln(2)/LAMZ |
LAMZ |
lambda_z negative of the best-fit terminal slope |
LAMZLL |
earliest time for LAMZ |
LAMZUL |
last time for LAMZ |
LAMZNPT |
number of points for LAMZ |
CORRXY |
correlation of log(concentration) and time |
R2 |
R-squared |
R2ADJ |
R-squared adjusted |
C0 |
back extrapolated concentration at time 0, for intravascular bolus administration only |
AUCLST |
AUC from 0 to TLST |
AUCALL |
AUC using all the given points, including trailing zero concentrations |
AUCIFO |
AUC infinity observed |
AUCIFOD |
AUCIFO / Dose |
AUCIFP |
AUC infinity predicted using CLSTP instead of CLST |
AUCIFPD |
AUCIFP / Dose |
AUCPEO |
AUC % extrapolation observed |
AUCPEP |
AUC % extrapolated for AUCIFP |
AUCPBEO |
AUC % back extrapolation observed, for bolus IV administration only |
AUCPBEP |
AUC % back extrapolation predicted with AUCIFP, for bolus IV administration only |
AUMCLST |
AUMC to the TLST |
AUMCIFO |
AUMC infinity observed using CLST |
AUMCIFP |
AUMC infinity determined by CLSTP |
AUMCPEO |
AUMC % extrapolated observed |
AUMCPEP |
AUMC % extrapolated predicted |
MRTIVLST |
mean residence time (MRT) to TLST, for intravascular administration |
MRTIVIFO |
mean residence time (MRT) infinity using CLST, for intravascular administration |
MRTIVIFP |
mean residence time (MRT) infinity using CLSTP, for intravascular administration |
MRTEVLST |
mean residence time (MRT) to TLST, for extravascular administration |
MRTEVIFO |
mean residence time (MRT) infinity using CLST, for extravascular administration |
MRTEVIFP |
mean residence time (MRT) infinity using CLSTP, for extravascular administration |
VZO |
volume of distribution determined by LAMZ and AUCIFO, for intravascular administration |
VZP |
volume of distribution determined by LAMZ and AUCIFP, for intravascular administration |
VZFO |
VZO for extravascular administration, VZO/F, F is bioavailability |
VZFP |
VZP for extravascular administration, VZP/F, F is bioavailability |
CLO |
clearance using AUCIFO, for intravascular administration |
CLP |
clearance using AUCIFP, for intravascular administration |
CLFO |
CLO for extravascular administration, CLO/F, F is bioavailability |
CLFP |
CLP for extravascular administration, CLP/F, F is bioavailability |
VSSO |
volume of distribution at steady state using CLST, for intravascular administration only |
VSSP |
volume of distribution at steady state using CLSTP, for intravascular administration only |
units |
An attribute to show units |
UsedPoints |
An attribute to show indices of used points |
Kyun-Seop Bae <[email protected]>
tblNCA(Theoph, key="Subject", dose=320, concUnit="mg/L") tblNCA(Indometh, key="Subject", colTime="time", colConc="conc", dose=25, adm="Infusion", dur=0.5, concUnit="mg/L")tblNCA(Theoph, key="Subject", dose=320, concUnit="mg/L") tblNCA(Indometh, key="Subject", colTime="time", colConc="conc", dose=25, adm="Infusion", dur=0.5, concUnit="mg/L")
It displays CDISC PP output units and multiplication factor for them.
Unit(code = "", timeUnit = "h", concUnit = "ng/mL", doseUnit = "mg", MW = 0)Unit(code = "", timeUnit = "h", concUnit = "ng/mL", doseUnit = "mg", MW = 0)
code |
vector of PPTESTCD |
timeUnit |
unit of time |
concUnit |
unit of concentration |
doseUnit |
unit of dose |
MW |
molecular weight of drug |
row names |
PPTESTCD |
Unit |
unit |
Factor |
internal mulitplication factor |
Kyun-Seop Bae <[email protected]>
Unit(concUnit="ug/L", doseUnit="mg") Unit(concUnit="ng/L", doseUnit="mg") Unit(concUnit="umol/L", doseUnit="mmol") Unit(concUnit="nmol/L", doseUnit="mmol") Unit(concUnit="mmol/L", doseUnit="mg", MW=500) Unit(concUnit="umol/L", doseUnit="mg", MW=500) Unit(concUnit="nmol/L", doseUnit="mg", MW=500) Unit(concUnit="nmol/mL", doseUnit="mg", MW=500) Unit(concUnit="ug/L", doseUnit="mmol", MW=500) Unit(concUnit="ug/L", doseUnit="mol", MW=500) Unit(concUnit="ng/L", doseUnit="mmol", MW=500) Unit(concUnit="ng/mL", doseUnit="mmol", MW=500) Unit(concUnit="nmol/L", doseUnit="mg") Unit(concUnit="ug/L", doseUnit="mmol")Unit(concUnit="ug/L", doseUnit="mg") Unit(concUnit="ng/L", doseUnit="mg") Unit(concUnit="umol/L", doseUnit="mmol") Unit(concUnit="nmol/L", doseUnit="mmol") Unit(concUnit="mmol/L", doseUnit="mg", MW=500) Unit(concUnit="umol/L", doseUnit="mg", MW=500) Unit(concUnit="nmol/L", doseUnit="mg", MW=500) Unit(concUnit="nmol/mL", doseUnit="mg", MW=500) Unit(concUnit="ug/L", doseUnit="mmol", MW=500) Unit(concUnit="ug/L", doseUnit="mol", MW=500) Unit(concUnit="ng/L", doseUnit="mmol", MW=500) Unit(concUnit="ng/mL", doseUnit="mmol", MW=500) Unit(concUnit="nmol/L", doseUnit="mg") Unit(concUnit="ug/L", doseUnit="mmol")
You can get a conversion factor for the multiplication: conc * vol * factor = amount in the given unit.
UnitUrine(conU = "ng/mL", volU = "mL", amtU = "mg", MW = 0)UnitUrine(conU = "ng/mL", volU = "mL", amtU = "mg", MW = 0)
conU |
concentration unit |
volU |
volume unit |
amtU |
amount unit |
MW |
molecular weight |
Factor |
conversion factor for multiplication with the unit in name |
Kyun-Seop Bae <[email protected]>
UnitUrine() UnitUrine("ng/mL", "mL", "mg") UnitUrine("ug/L", "mL", "mg") UnitUrine("ug/L", "L", "mg") UnitUrine("ng/mL", "mL", "g") UnitUrine("ng/mL", "mL", "mol", MW=500) UnitUrine("ng/mL", "mL", "mmol", MW=500) UnitUrine("ng/mL", "mL", "umol", MW=500)UnitUrine() UnitUrine("ng/mL", "mL", "mg") UnitUrine("ug/L", "mL", "mg") UnitUrine("ug/L", "L", "mg") UnitUrine("ng/mL", "mL", "g") UnitUrine("ng/mL", "mL", "mol", MW=500) UnitUrine("ng/mL", "mL", "mmol", MW=500) UnitUrine("ng/mL", "mL", "umol", MW=500)
Write the standard R ‘MD5’ manifest into an installed package directory so that
checkMD5sums (and IQNCA) can verify file
integrity. The manifest records the md5 checksum of every installed file. It is the
same ‘MD5’ file that CRAN ships and that R's own installer writes; packages
installed from CRAN already contain it, but a local source install usually does not
(which is why the IQ integrity check then reports WARN). Run writeMD5NCA() once,
immediately after installing the package, to record the trusted baseline; thereafter
checkMD5sums() detects any later modification of the installed files.
writeMD5NCA(pkg = "NonCompart", lib.loc = NULL)writeMD5NCA(pkg = "NonCompart", lib.loc = NULL)
pkg |
name of the installed package whose ‘MD5’ manifest should be written. |
lib.loc |
character vector of library paths to search for |
The manifest is written in the format used by checkMD5sums: one line per file,
<md5sum> *<relative-path>. The ‘MD5’ file itself is excluded. The
function uses only the exported md5sum. The installed package
directory must be writable.
Invisibly, the path to the ‘MD5’ file that was written. Called for its side effect.
Kyun-Seop Bae <[email protected]>
#writeMD5NCA("NonCompart") #NonCompart::IQNCA() # the file-integrity check now reports PASS#writeMD5NCA("NonCompart") #NonCompart::IQNCA() # the file-integrity check now reports PASS