## load example data
data("ExampleData.BINfileData", envir = environment())
## EXAMPLE 1
## convert Risoe.BINfileData object to RLum.Analysis object
data <- Risoe.BINfileData2RLum.Analysis(object = CWOSL.SAR.Data, pos = 8, ltype = "OSL")
## extract all OSL curves
allCurves <- get_RLum(data)
## keep only the natural and regenerated signal curves
pos <- seq(1, 9, 2)
curves <- allCurves[pos]
## plot a standard NR(t) plot
plot_NRt(curves)
## re-plot with rolling mean data smoothing
plot_NRt(curves, smooth = "rmean", k = 10)
## re-plot with a logarithmic x-axis
plot_NRt(curves, log = "x", smooth = "rmean", k = 5)
## re-plot with custom axes ranges
plot_NRt(curves, smooth = "rmean", k = 5,
xlim = c(0.1, 5), ylim = c(0.4, 1.6),
legend.pos = "bottomleft")
## re-plot with smoothing spline on log scale
plot_NRt(curves, smooth = "spline", log = "x",
legend.pos = "top")
## EXAMPLE 2
# you may also use this function to check whether all
# TD curves follow the same shape (making it a TnTx(t) plot).
posTD <- seq(2, 14, 2)
curves <- allCurves[posTD]
plot_NRt(curves, main = "TnTx(t) Plot",
smooth = "rmean", k = 20,
ylab = "TD natural / TD regenerated",
xlim = c(0, 20), legend = FALSE)
## EXAMPLE 3
# extract data from all positions
data <- lapply(1:24, FUN = function(pos) {
Risoe.BINfileData2RLum.Analysis(CWOSL.SAR.Data, pos = pos, ltype = "OSL")
})
# get individual curve data from each aliquot
aliquot <- lapply(data, get_RLum)
# set graphical parameters
par(mfrow = c(2, 2))
# create NR(t) plots for all aliquots
for (i in 1:length(aliquot)) {
plot_NRt(aliquot[[i]][pos],
main = paste0("Aliquot #", i),
smooth = "rmean", k = 20,
xlim = c(0, 10),
cex = 0.6, legend.pos = "bottomleft")
}
# reset graphical parameters
par(mfrow = c(1, 1))
Run the code above in your browser using DataLab