Learn R Programming

rgr (version 1.1.15)

ad.plot4: Plot Results of Analytical Duplicate Analyses as Ratios, Alternate Input

Description

Function to prepare data stored in alternate forms from that expected by function ad.plot3 for its use, for further details see x in Arguments below. The data will be plotted as ratios, i.e. dup1/dup2, with logarithmic scaling relative to their means.

Usage

ad.plot4(x, xname = deparse(substitute(x)), if.order = FALSE, ad.tol = NULL,
        ifalt = FALSE, ldl = NULL, maxrat = NULL, if.text = FALSE,
        if.cpp = 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

a title can be displayed with the plot and results, e.g., xname = "Cu (mg/kg)". If this field is undefined the character string for x is used as a default.

if.order

by default the analytical duplicate results are plotted in the order in which they occur in the data file, this usually corresponds to date of analysis. Alternately, setting if.order = FALSE results in the results being plotted against their means.

ad.tol

optionally a tolerance level may be provided for the maximum acceptable percent ratio between duplicates, in which case a red dotted line is added to the plot.

ifalt

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

ldl

if the lower detection limit (ldl) of the analytical procedure is provided and falls within the range of the duplicate means it will be plotted as a vertical black dotted line. If another colour is required, e.g., red, set col = 2. See function display.lty for the range of available colours.

maxrat

optionally the maximum ratio for the plot axis, the minimum is computed as 1/maxrat, may be set. This is useful when making comparisons between elements or between measurement methods and ensures similar scaling. Otherwise maxrat is determined from the data.

if.text

if set if.text = TRUE the locator is deployed so that the ratios for estimating the 95% confidence bounds on any value may be placed on the ratio plot.

if.cpp

if set if.cpp = TRUE the ratio plot is displayed side-by-side with an Normal Cumulative Probability Plot (CPP) of the ratios. In this instance if.text is not an option.

any additional arguments to be passed to the plot function for titling, etc.

Details

Data may be as a single concatenated vector from a matrix or data frame as x1[1], ..., x1[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, see ifalt.

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

See Also

ad.plot3, ad.plot1, ltdl.fix.df

Examples

Run this code
# NOT RUN {
## Make test data available
data(ad.test)
attach(ad.test)

## Plot analytical duplicate analyses as ratios in acquistion sequence
ad.plot4(Cu, ifalt = TRUE)

## Plot analytical duplicate analysis ratios against their means with
## more informative annotation
ad.plot4(Cu, "Cu (mg/kg)", ifalt = TRUE, if.order = FALSE)

## Plot analytical duplicate analysis ratios against their means with a
## CPP of the ratios and more informative annotation
ad.plot4(Cu, "Cu (mg/kg)", ifalt = TRUE, if.order = FALSE, if.cpp = TRUE)

## Detach test data
detach(ad.test)
# }

Run the code above in your browser using DataLab