alts2dups: Create a Matrix of Duplicate Pairs from Sequential Data

Description Usage Arguments Details Value Note Author(s) Examples

Description

Function to take data stored as stacked records or alternating rows of records for ndup duplicate pairs and generate a matrix with ndup rows and two columns for the duplicate data, for further details see x in Arguments below. The function returns a matrix for processing.

Usage

1
alts2dups(x, 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.

ifalt

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

Details

Function provides an easy procedure with function plot to present duplicate data as an x-y plot. The matrix generated can be passed directly to plot in its call and the matrix column headings synthesized from the input variable name are used as plot axis titles.

Value

xx

a ndup by 2 matrix containing the duplicate pairs. Row names are sequenced 1:ndup and the two column names are generated from the input variable name, x with .1 or .2 appended, respectively.

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Make test data available
data(ad.test)
attach(ad.test)

## Save matrix of duplicate pairs
test.save <- alts2dups(Cu, ifalt = TRUE)

## Plot analytical duplicate analyses
plot(alts2dups(Cu, ifalt = TRUE), log = "xy")

## Clean-up and detach test data
rm(test.save)
detach(ad.test)

Example output

Loading required package: MASS
Loading required package: fastICA

rgr documentation built on May 2, 2019, 6:09 a.m.

Related to alts2dups in rgr...