There is a rare case causing warning messages of the form:
Warning message: In (index.min - min(m, index.min - 1)):(index.min + min(m, nrow(region) - : numerical expression has 2 elements: only the first used
if a spectrum has two identical intensity values in the region where the script searches for minima (and I suspect it would also appear for maxima). @frank-m-wang reported this issue to me (henningte/irpeat#1).
A possible solution would be to add [[1]] to the end of lines 84 and 119 in FTIRbaselines.R which lets the function pick always the first minimum/maximum it detects.
I didn't test it yet, but would like to update this in irpeat, too (or like to ask you to do so), if you'll add this change to your repository.
There is a rare case causing warning messages of the form:
Warning message: In (index.min - min(m, index.min - 1)):(index.min + min(m, nrow(region) - : numerical expression has 2 elements: only the first usedif a spectrum has two identical intensity values in the region where the script searches for minima (and I suspect it would also appear for maxima). @frank-m-wang reported this issue to me (henningte/irpeat#1).
A possible solution would be to add
[[1]]to the end of lines 84 and 119 in FTIRbaselines.R which lets the function pick always the first minimum/maximum it detects.I didn't test it yet, but would like to update this in irpeat, too (or like to ask you to do so), if you'll add this change to your repository.