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

Make .Risoe.BINfileData2RLum.Data.Curve() work without the id argument #227

Closed mcol closed 1 week ago

mcol commented 1 week ago

If id is not passed as an argument, the function tries to resolve it by using the pos, run and set arguments, but this error would occur:

.Risoe.BINfileData2RLum.Data.Curve(CWOSL.SAR.Data, pos = 1, set = 2, run = 1)
# Error in METADATA[METADATA[["POSITION"]] == pos & METADATA[["SET"]] == :
#   incorrect number of dimensions

As METADATA is converted from data.frame to a list a few lines before, it cannot be accessed any longer with the data.frame indexing, but is should use the standard list accessor.

This was an ancient bug introduced in bb8cf69, but totally harmless since it's in an internal function that is never called without the id argument.