R-Lum / Luminescence

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

errors when plotting from fit_EmissionSpectra() #161

Closed mcol closed 2 months ago

mcol commented 3 months ago

This doesn't fail when run on it own, but if run by devtools::test() (or just after it), it will fail:

data(ExampleData.XSYG, envir = environment())
TL.Spectrum@data <- TL.Spectrum@data[] - TL.Spectrum@data[,15]
fit_EmissionSpectra(object = TL.Spectrum, frame = 5, plot = TRUE, method_control = list(max.runs = 10))

# Error in split.screen(rbind(c(0.1, 1, 0.32, 0.98), c(0.1, 1, 0.1, 0.315))) : 
#   invalid screen number
# Error in par(.SSget("sp.saved.pars")) : 
#   parameter "i" in "mfg" is out of range

Presumably some test run before we reach this is messing up our state.

mcol commented 3 months ago

Some bisecting has eventually led me to identify test_combine_DeDr.R as a potential culprit: it turns out that it sets par(mfrow=c(2,2)) but does not undo it, and that creates the problem above when calling split.screen().

mcol commented 2 months ago

Fixed by 80f1031.