Unable to understand 1 note in devtools::check() caused by a platform-specific device (X11)

554 Views Asked by At

I'm trying to upload my package to CRAN and using devtools::check(), but I'm not able to understand why the function is showing 1 note.

The code is available in my repository. The check function shows the following message:


Duration: 44.3s

> checking R code for possible problems ... NOTE
  Found an obsolete/platform-specific call in the following function:
    'consulta_pedidos'
  Found the platform-specific device:
    'X11'
  dev.new() is the preferred way to open a new device, in the unlikely
  event one is needed.

0 errors √ | 0 warnings √ | 1 note x

Does anyone know the reason of this? Thank you in advance!

1

There are 1 best solutions below

0
On BEST ANSWER

I'm pretty sure this is a false positive, from this code:

I haven't analyzed this in detail, but I think what's happening is that:

  • you are using the symbol X11 in your code (as part of a non-standard evaluation/symbolic pipeline)
  • when the checking code in R looks up that symbol, it finds a function ("closure") with that name in package::grDevices
  • it checks for specific 'bad' closures: bad_dev <- c("quartz", "x11", "X11")
  • it concludes that you're using a platform-specific graphics call and complains.

This might be worth submitting as a bug report, or at least for discussion (either on [email protected] or [email protected]).