thplot1 {rgr} | R Documentation |
Function displays a Thompson-Howarth (1973 & 1978) plot for a set of duplicate measurements to visually inspect them as a part of the QA/QC process. By inputting a target precision the data may be visually checked to determine if they meet that criterion.
thplot1(x1, x2, name = "", ifzero = 0.01, xlow = NA, xhih = NA, yhih = NA, rsd = 5, ptile = 95, main = "")
x1 |
a column vector from a matrix or data frame, x1[1], ..., x1[n] . |
x2 |
another column vector from a matrix or data frame, x2[1], ..., x2[n] . x1,x2 must be of identical length, n, where x2 is a duplicate measurement of x1 . |
name |
a title can be displayed with the results, e.g., “name = Magnetic Susceptibility”. If this field is undefined the character string for x1 is used as a default. |
ifzero |
as the Thompson-Howarth plot is log-scaled values of zero cannot be displayed, therefore the parameter ifzero has to be specified. A suitable choice is a value one order of magnitude lower than the value of the detection limit. A default value of ifzero = 0.01 units is provided, corresponding to a detection limit of 0.1 units. |
xlow |
if is desired to produce plots with consistent scaling this may be achieved by defining xlow , xhih and yhih , the ylow value is set equal to ifzero . Enter an appropriate value of xlow to ensure all data are displayed on all plots. |
xhih |
enter an appropriate value of xhih to ensure all data are displayed on all plots. |
yhih |
enter an appropriate value of yhih to ensure all data are displayed on all plots. |
rsd |
to assist in QA/QC inspection a target precision may be defined as a RSD%, a default of rsd = 5 is provided. See comments concerning RSD in Details below. |
ptile |
defines the confidence interval for a line to be drawn on the plot above which only 100 - ptile% of the points should plot if the defined target RSD is being met. A default of ptile = 95 is provided. The function counts the number of points falling ‘out of limits’ and reports the probability that this number would have fallen ‘out of limits’ by chance alone. |
main |
a title may be added optionally above the display, e.g., main = "Stanley (2003) Test Data" . |
This function expects the RSD% as a measure of measurement repeatability (precision), which is more familiar to the current generation of applied geochemists, rather than the precision at the 2 Standard Deviation level. The necessary calculations to conform with the Thompson and Howarth procedure are made internally.
Duplicate pairs containing any NA
s are omitted from the calculations.
If the data are as a single concatenated vector from a matrix or data frame as x[1], ..., x[n]
followed by x[n+1], ..., x[2n]
, or alternated as x[1]
and x[2]
being a pair through to x[2*i+1]
and x[2*i+2]
, for the i in 1:n
duplicate pairs use function thplot2
.
Any less than detection limit values represented by negative values, or zeros or other numeric codes representing blanks in the data vector, must be removed prior to executing this function, see ltdl.fix.df
.
Duplicate pairs x1,x2
containing any NA
s are omitted from the calculations.
This script was published by Garrett and Grunsky (2003)
Robert G. Garrett
Garrett, R.G. & Grunsky, E.C., 2003. S and R functions to display Thompson-Howarth plots. Computers & Geosciences 29(2):239-242.
Stanley, C.R., 2003. THPLOT.M: A MATLAB function to implement generalized Thompson-Howarth error analysis using replicate data. Computers & Geosciences 29(2):225-237.
Thompson, M. and Howarth, R.J, 1973. The rapid estimation and control of precision by duplicate determinations. The Analyst, 98(1164):153-160.
Thompson, M. and Howarth, R.J., 1978. A new approach to the estimation of analytical precision. Journal of Geochemical Exploration, 9(1):23-30.
## Make the Stanley (2003) test data available data(ms.data1) attach(ms.data1) # Display the default plot thplot1(MS.1, MS.2, name = "Magnetic Susceptibility", main = "Stanley (2003) Test Data") # Display a Thompson-Howarth plot for a RSD of 7.5% and a draw the limit for a # confidence interval of 90% thplot1(MS.1, MS.2, name = "Magnetic Susceptibility", rsd = 7.5, ptile = 90, main = "Stanley (2003) Test Data") ## Detach test data detach(ms.data1)