list of RLum.Data.Curve
(required): list of S4 objects of class RLum.Curve.
merge.method
character (required): method for
combining of the objects, e.g. 'mean', 'sum', see details for
further information and allowed methods. Note: Elements in slot info will
be taken from the first curve in the list.
method.info
numeric (optional): allows to specify how
info elements of the input objects are combined, e.g. 1 means that
just the elements from the first object are kept, 2 keeps only the
info elements from the 2 object etc. If nothing is provided all elements
are combined.
Details
This function simply allowing to merge RLum.Data.Curve
objects without touching the objects itself. Merging is always applied on
the 2nd colum of the data matrix of the object.
Supported merge operations are
RLum.Data.Curve
"sum"
All count values will be summed up using the function rowSums.
"mean"
The mean over the count values is calculated using the function
rowMeans.
"median"
The median over the count values is calculated using the function
rowMedians.
"sd"
The standard deviation over the count values is calculated using the function
rowSds.
"var"
The variance over the count values is calculated using the function
rowVars.
"min"
The min values from the count values is chosen using the function
rowMins.
"max"
The max values from the count values is chosen using the function
rowMins.
"-"
The row sums of the last objects are subtracted from the first object.
"*"
The row sums of the last objects are mutliplied with the first object.
"/"
Values of the first object are divided by row sums of the last objects.
Value
Returns an RLum.Data.Curve object.
S3-generic support
This function is fully operational via S3-generics:
`+`, `-`, `/`, `*`, merge
Function version
0.2.0 (2016-05-02 09:36:06)
Note
The information from the slot 'recordType' is taken from the first
RLum.Data.Curve object in the input list. The slot
'curveType' is filled with the name merged.
Author(s)
Sebastian Kreutzer, IRAMAT-CRP2A, Universite Bordeaux Montaigne
(France)
R Luminescence Package Team
References
-
See Also
merge_RLum, RLum.Data.Curve
Examples
##load example data
data(ExampleData.XSYG, envir = environment())
##grep first and 3d TL curves
TL.curves <- get_RLum(OSL.SARMeasurement$Sequence.Object, recordType = "TL (UVVIS)")
TL.curve.1 <- TL.curves[[1]]
TL.curve.3 <- TL.curves[[3]]
##plot single curves
plot_RLum(TL.curve.1)
plot_RLum(TL.curve.3)
##subtract the 1st curve from the 2nd and plot
TL.curve.merged <- merge_RLum.Data.Curve(list(TL.curve.3, TL.curve.1), merge.method = "/")
plot_RLum(TL.curve.merged)
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(Luminescence)
Welcome to the R package Luminescence version 0.6.0 [Built: 2016-05-30 16:47:30 UTC]
An unbiased reviewer: 'The data is too poor to be published in QG, try a higher ranked journal.'
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Luminescence/merge_RLum.Data.Curve.Rd_%03d_medium.png", width=480, height=480)
> ### Name: merge_RLum.Data.Curve
> ### Title: Merge function for RLum.Data.Curve S4 class objects
> ### Aliases: merge_RLum.Data.Curve
> ### Keywords: utilities
>
> ### ** Examples
>
>
>
> ##load example data
> data(ExampleData.XSYG, envir = environment())
>
> ##grep first and 3d TL curves
> TL.curves <- get_RLum(OSL.SARMeasurement$Sequence.Object, recordType = "TL (UVVIS)")
> TL.curve.1 <- TL.curves[[1]]
> TL.curve.3 <- TL.curves[[3]]
>
> ##plot single curves
> plot_RLum(TL.curve.1)
> plot_RLum(TL.curve.3)
>
> ##subtract the 1st curve from the 2nd and plot
> TL.curve.merged <- merge_RLum.Data.Curve(list(TL.curve.3, TL.curve.1), merge.method = "/")
Warning message:
In merge_RLum.Data.Curve(list(TL.curve.3, TL.curve.1), merge.method = "/") :
8 'inf' values have been replaced by 0 in the matrix.
> plot_RLum(TL.curve.merged)
>
>
>
>
>
>
> dev.off()
null device
1
>