Ar-Ar_Redux: rigorous error propagation of 40Ar/39Ar data with R

Ar-Ar_Redux is a 40Ar/39Ar data reduction package in the R programming environment, which takes into account all covariances in the error propagation, including those associated with multi-collector mass spectrometry. Caveats: (a) in its current version, the program is command-line based. A more user-friendly version with graphical user interface is in development; (b) Ar-Ar_Redux currently only reads Argus-VI data. Functionality for other data will be added based on user feedback. (c) Ar-Ar_Redux has not yet been extensively tested. Any help with this will be gratefully accepted. For details about the underlying algorithms, see Vermeesch, P., 2015. Revised error propagation of 40Ar/39Ar data, including covariances. Geochimica et Cosmochimica Acta, 171, pp.325-337.

After installing R from http://r-project.org, Ar-Ar_Redux can be installed by typing
install.packages('ArArRedux')
Once installed, the package can be loaded by typing
library(ArArRedux)
This page contains a number of very simple tutorials illustrating the most common usages of the package. Full documentation of the public functions is provided in this PDF document. For this tutorial, we will use the following example input files, which are also built into Ar-Ar_Redux and accessible through the system.file() command:

Downloads
Samples.csv some ARGUS-VI sample data from the University of Melbourne
irradiations.csv the irradiation schedule
Ca-salt.csv isotopic analyses of the Ca-interference monitors
K-glass.csv isotopic analyses of the K-interference monitors
Calibration.csv detector intercalibration data
AirH1.csv mass fractionation measurement on detector H1
AirAX.csv mass fractionation measurement on detector AX
AirL2.csv mass fractionation measurement on detector L2
AirL1.csv mass fractionation measurement on detector L1

The following lines of code plot the time resolved 40Ar signal of sample "MD2-1a":
masses <- c("Ar37","Ar38","Ar39","Ar40","Ar36")
d <- loaddata("Samples.csv",masses)
plot(d,"MD2-1a","Ar40")
The next example shows the simplest case of a data reduction without interference corrections, detector calibrations or fractionation correction:
# order of the columns in 'Samples.csv'
masses <- c("Ar37","Ar38","Ar39","Ar40","Ar36")
# prefix of the blanks in 'Samples.csv'
blanklabel <- "EXB#"
# positions of the fluence monitors in 'Samples.csv'
Jpos <- c(3,15)

# read the data into a logratio covariance structure
X <- read("Samples.csv",masses,blanklabel,Jpos)
# load the irradiation schedule (power and duration)
irr <- loadirradiations("irradiations.csv")
# calculate the ages and their coveriances
ages <- process(X,irr)
# print a table with ages and standard errors
summary(ages)
A full example including interference corrections, detector calibrations and fractionation correction:
# see previous example for details about the next three lines
masses <- c("Ar37","Ar38","Ar39","Ar40","Ar36")
blanklabel <- "EXB#"
Jpos <- c(3,15)

# order of the columns in Calibration.csv
dlabels <- c("H1","AX","L1","L2")

X <- read("Samples.csv",masses,blanklabel,Jpos,kfile="K-glass.csv",
          cafile="Ca-salt.csv",dfile="Calibration.csv",dlabels)
irr <- loadirradiations("irradiations.csv")

# create a list with fractionation corrections for the denominator isotopes of the age equation
fract <- list(Ar37=fractionation("AirL2.csv","L2",PH=TRUE),
	      Ar39=fractionation("AirAX.csv","AX",PH=TRUE)
              Ar40=fractionation("AirH1.csv","H1",PH=FALSE))

ages <- process(X,irr,fract)
summary(ages)
In the following example, the interference corrections are specified manually, rather than from co-irradiated K-glass or Ca-salt:
# see previous examples for details of next six lines
masses <- c("Ar37","Ar38","Ar39","Ar40","Ar36")
blanklabel <- "EXB#"
Jpos <- c(3,15)
X <- read("Samples.csv",masses,blanklabel,Jpos)
irr <- loadirradiations("irradiations.csv")
fract <- list(Ar37=fractionation("AirL2.csv","L2",PH=TRUE),
	      Ar39=fractionation("AirAX.csv","AX",PH=TRUE)
              Ar40=fractionation("AirH1.csv","H1",PH=FALSE))

# assume log(36Ar/37Ar) = log(39Ar/37Ar) in Ca-salt 
# with variances = 0.0001 and covariances = 0
ca <- interference(intercepts=c(1,1),num=c("Ar39","Ar36"),
                   den=c("Ar37","Ar37"),irr="UM52",label="Ca-salt",
                   covmat=matrix(c(0.001,0,0,0.001),nrow=2))
# assume log(40Ar/39Ar) = -4.637788 in co-irradiated 
# K-glass with variance 7.9817e-4
k <- interference(intercepts=-4.637788,covmat=7.9817e-4,num="Ar40",
                  den="Ar39",irr="UM52",label="K-glass")

ages <- process(X,irr,fract,ca,k)
summary(ages)
Default parameters, such as the standard age, air ratio or decay constants can be queried or modified using the param function:
# query the air ratio
param(X)$air
# modify the standard age (ts) and its standard error (sts)
Y <- param(X, ts=27.4, sts=0.4)
# list all the parameters
param(Y)
Post processing the results:
# calculate and print the weighted mean of all samples with prefix "FC"
print(weightedmean(ages,"FC"))

# calculate the weighted mean of a list of samples
print(weightedmean(ages,c("MD2-1c","MD2-1d","MD2-1e","MD2-1f","MD2-1g")))

# plot the covariance structure of the ages as a correlation matrix
plotcorr(ages)
The output of the plotcorr function is shown in the image at the top of this page. Counting from the lower left corner of the matrix, each row or column corresponds to a sample, in the order given by ages$labels.