Recursively concatenates a list of logratio data into one big dataset
Usage
concat(lrlist)
Arguments
lrlist
a list containing items of class
logratios or redux
Value
an object of the same class as x containing the
merged dataset
Examples
samplefile <- system.file("Samples.csv",package="ArArRedux")
kfile <- system.file("K-glass.csv",package="ArArRedux")
cafile <- system.file("Ca-salt.csv",package="ArArRedux")
dfile <- system.file("Calibration.csv",package="ArArRedux")
masses <- c("Ar37","Ar38","Ar39","Ar40","Ar36")
blanklabel <- "EXB#"
Jpos <- c(3,15)
dlabels <- c("H1","AX","L1","L2")
m <- loaddata(samplefile,masses) # samples and J-standards
mk <- loaddata(kfile,masses) # K-interference data
mca <- loaddata(cafile,masses) # Ca interference data
md <- loaddata(dfile,dlabels,PH=TRUE) # detector intercalibrations
# form and fit logratios
l <- fitlogratios(blankcorr(m,blanklabel),"Ar40")
lk <- fitlogratios(blankcorr(mk,blanklabel,"K:"),"Ar40")
k <- getmasses(lk,"Ar39","Ar40") # subset on the relevant isotopes
lca <- fitlogratios(blankcorr(mca,blanklabel,"Ca:"),"Ar37")
ca <- getmasses(lca,c("Ar36","Ar39"),c("Ar37","Ar37")) # subset
ld <- fitlogratios(blankcorr(md))
d <- averagebyday(ld,"DCAL")
# merge all data (except air shots) into one big logratio structure
X <- newredux(concat(list(l,k,ca,d)),Jpos)
data(Melbourne)
if (isTRUE(all.equal(Melbourne$X,X))) {
print("We just reconstructed the built-in dataset Melbourne$X")}
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(ArArRedux)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ArArRedux/concat.Rd_%03d_medium.png", width=480, height=480)
> ### Name: concat
> ### Title: Merge a list of logratio data
> ### Aliases: concat
>
> ### ** Examples
>
> samplefile <- system.file("Samples.csv",package="ArArRedux")
> kfile <- system.file("K-glass.csv",package="ArArRedux")
> cafile <- system.file("Ca-salt.csv",package="ArArRedux")
> dfile <- system.file("Calibration.csv",package="ArArRedux")
> masses <- c("Ar37","Ar38","Ar39","Ar40","Ar36")
> blanklabel <- "EXB#"
> Jpos <- c(3,15)
> dlabels <- c("H1","AX","L1","L2")
>
> m <- loaddata(samplefile,masses) # samples and J-standards
> mk <- loaddata(kfile,masses) # K-interference data
> mca <- loaddata(cafile,masses) # Ca interference data
> md <- loaddata(dfile,dlabels,PH=TRUE) # detector intercalibrations
>
> # form and fit logratios
> l <- fitlogratios(blankcorr(m,blanklabel),"Ar40")
> lk <- fitlogratios(blankcorr(mk,blanklabel,"K:"),"Ar40")
> k <- getmasses(lk,"Ar39","Ar40") # subset on the relevant isotopes
> lca <- fitlogratios(blankcorr(mca,blanklabel,"Ca:"),"Ar37")
> ca <- getmasses(lca,c("Ar36","Ar39"),c("Ar37","Ar37")) # subset
> ld <- fitlogratios(blankcorr(md))
> d <- averagebyday(ld,"DCAL")
>
> # merge all data (except air shots) into one big logratio structure
> X <- newredux(concat(list(l,k,ca,d)),Jpos)
> data(Melbourne)
> if (isTRUE(all.equal(Melbourne$X,X))) {
+ print("We just reconstructed the built-in dataset Melbourne$X")}
>
>
>
>
>
> dev.off()
null device
1
>