Display a Thompson-Howarth Plot of Duplicate Measurements, Alternate Input

Share:

Description

Function to prepare data stored in alternate forms from that expected by function thplot1 for its use. For further details see 'x' in Arguments below. The user is prompted for the location of the two legend items.

Usage

1
2
3
thplot2(x, xname = deparse(substitute(x)), ifzero = 0.01, 
	xlow = NA, xhih = NA, yhih = NA, rsd = 5, ptile = 95, main = "", 
	ifalt = FALSE, ...)

Arguments

x

a column vector from a matrix or data frame, x[1], ..., x[2*n]. The default is that the first n members of the vector are the first measurements and the second n members are the duplicate measurements. If the measurements alternate, i.e. duplicate pair 1 measurement 1 followed by measurement 2, etc., set ifalt = TRUE.

xname

by default the character string for x is used for the title. An alternate title can be displayed with xlab = "text string", see Examples.

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, 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, see Example.

ifalt

set ifalt = TRUE to accommodate alternating sets of paired observations.

...

further arguments to be passed to methods. For example, the size of the axis scale annotation can be change by setting cex.axis, the size of the axis titles by seetting cex.lab, and the size of the plot title by setting cex.main. For example, if it is required to make the plot title smaller, add cex.main = 0.9 to reduce the font size by 10%.

Details

This function expects the RSD% as a measure of 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.

For further details see thplot1.

Duplicate pairs containing any NAs are omitted from the calculations.

If the data are as n duplicate pairs, x1 and x2, use function thplot1.

The user is prompted for the location of the two legend items added to the plot, the number of duplicate pairs, and whether or not the duplicates have met the RSD% criterion. In both instances the user is prompted for the location of the left end of the text line, or the top left corner of the text block.

Note

Any less than detection limit values represented by negative values, or zeros or other numeric codes representing blanks in the data, must be removed prior to executing this function, see ltdl.fix.df.

Author(s)

Robert G. Garrett

See Also

thplot1, ltdl.fix.df

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## NOTE: the examples below are commented out as thplot1 makes a
## call to the locator function that fails when the examples are run
## during package checking and building

## Make test data available
##data(ms.data2)
##attach(ms.data2)
 
## Display the default plot
##thplot2(MS, xname = "Magnetic Susceptibility", 
##	main = "Stanley (2003) Test Data")

## Detach test data
##detach(ms.data2)

## Make test data available
##data(ms.data3)
##attach(ms.data3)

## Display a Thompson-Howarth plot for a RSD of 7.5% and draw
## the limit for a confidence interval of 90%
##thplot2(MS, xname = "Magnetic Susceptibility", rsd = 7.5, ptile = 90,
##	main = "Stanley (2003) Test Data", ifalt = TRUE)

## Detach test data
##detach(ms.data3)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.