Learn R Programming

rgr (version 1.0.4)

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

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.

Usage

thplot2(x, name = 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. dup
name
a title can be displayed with the results, e.g., name = "Magnetic Susceptibility". If this field is undefined the character string for x 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 va
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 appropria
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 f
main
a title may be added optionally above the display, e.g., main = "Stanley (2003) Test Data"
ifalt
set ifalt = TRUE to accommodate alternating sets of paired observations.

Details

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. For further details see thplot1. If the data are as n duplicate pairs, x1 and x2, use function thplot1.

See Also

thplot1, ltdl.fix.df

Examples

Run this code
## Make test data ms.data2 available
data(ms.data2)
attach(ms.data2)

## Display the default plot
thplot2(MS, name = "Magnetic Susceptibility", 
	main = "Stanley (2003) Test Data")

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

## Make test data ms.data3 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, name = "Magnetic Susceptibility", rsd = 7.5, ptile = 90,
	main = "Stanley (2003) Test Data", ifalt = TRUE)

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

Run the code above in your browser using DataLab