R-Lum / Luminescence

Development of the R package 'Luminescence'
http://r-lum.github.io/Luminescence/
GNU General Public License v3.0
15 stars 7 forks source link

confusing errors from plot_RLum.Analysis() with curve transformation #294

Closed mcol closed 4 weeks ago

mcol commented 4 weeks ago

There is a strange interaction between recordType and curve.transformation in plot_RLum.Analysis():

data(ExampleData.BINfileData, envir = environment())
temp <- Risoe.BINfileData2RLum.Analysis(CWOSL.SAR.Data, pos = 1)

## this works ----------------------------
plot_RLum.Analysis(temp,
    subset = list(recordType = "OSL"),
    curve.transformation = "CW2pHMi")

Looking at the code for CW2pHMi (and similarly for the other CW2p* functions), the check recordType to be OSL or IRSL applies only if it receives an RLum.Data.Curve object.

Unfortunately, the use of curve.transformation in plot_RLum.Analysis() was not tested, so I'm not sure what is the expected behaviour. For example, the next two examples work, but perhaps they shouldn't?

## this works ----------------------------
plot_RLum.Analysis(temp,
    subset = list(recordType = "TL"),
    curve.transformation = "CW2pHMi")

## this works ----------------------------
plot_RLum.Analysis(temp,
    subset = list(recordType = "TL"),
    combine = TRUE,
    curve.transformation = "CW2pHMi")
mcol commented 4 weeks ago

I actually think it's fine as it is. In the TL case, plot_RLum.Analysis() doesn't apply the curve transformation, so it's fine that the last two cases work.