Closed mcol closed 2 hours ago
@mcol We should not use subset()
in the package, this causes all kinds of trouble, instead with should check whether there is any irradiation step at all in present. For the moment the function simply relies in the existence of such step (which is not good, I know).
I don't know why I wrote subset()
, what's happening is a simple subsetting of a data frame.
This way of subsetting will produce the wrong result if
results[,"STEP"] == "irradiation (NA)"
is alwaysFALSE
: https://github.com/R-Lum/Luminescence/blob/cc0b78100bba1d55ee091f2eed777ae0a0e0bf89/R/extract_IrradiationTimes.R#L364In such a case,
which()
would returninteger(0)
, andsubset()
would remove all rows, when actually we'd want to keep them all. Using a logical expression insubset()
is safer.When this happens, we may wrongly refuse to update the BIN file.