Skip to content
Prev 5805 / 12125 Next

[R-pkg-devel] Error in CHECK caused by dev.off()

Hi Serguei,

Serguei Sokol wrote on 2020-07-22 15:51:
I _can_ built the package and it runs as intended. Only the CHECK throws 
the error.
Closing the device is required only _once_ in the entire package.
In my NAMESPACE I have (and had in all previous versions):
importFrom(grDevices, png, graphics.off, dev.list, dev.off)
The problem is that I cannot reproduce it as well. Only CHECK laments 
about dev.off() which I changed to graphics.off() in the meantime.

library(grDevices)
foo <- TRUE?? # shall we plot?
png.path <- "~/" # user's home folder
png.path <- normalizePath(png.path)
if (foo) {
 ? png(paste0(png.path, "test.png"), width = 480, height = 480, 
pointsize = 12)
}
plot(x = 0:1, y = 0:1, type = "l", xlab = "x", ylab = "y")
if (foo) {
 ? graphics.off()
}

Best,
Helmut