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

Helmut Schütz he|mut@@chuetz @end|ng |rom beb@c@@t
Wed Jul 22 19:25:55 CEST 2020


Hi Serguei,

Serguei Sokol wrote on 2020-07-22 15:51:
> Hmm... I see 2 possibilities for still getting an error while the 
> concerned part of code is not supposed to be run:
>
>  - either you are running not updated version of your package;

I _can_ built the package and it runs as intended. Only the CHECK throws 
the error.

>  - or the error comes from some other place of the code.

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)

> Sorry but without a minimal reproducible example I cannot help more.

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

-- 
Ing. Helmut Schütz
BEBAC – Consultancy Services for
Bioequivalence and Bioavailability Studies
Neubaugasse 36/11
1070 Vienna, Austria
T +43 1 2311746
M +43 699 10792458
E helmut.schuetz using bebac.at
W https://bebac.at/
C https://bebac.at/Contact.htm
F https://forum.bebac.at/
GIS 24799386, VAT ATU61115625, DUNS 300370568, EORI ATEOS1000096209
GDPR https://bebac.at/Data-Protection.htm



More information about the R-package-devel mailing list