'Why does grid::grid.grabExpr try to open an X11 connection, and how can I prevent it?
On Linux, run
DISPLAY= R, then issuegrid::grid.grabExpr(1). This works fine, sogrid::grid.grabExprdoes not need an X11 connection.Run
DISPLAY=XYZ Rand issue the same command. I am now gettingError in .External2(C_X11, d$display, d$width, d$height, d$pointsize, : unable to start device X11cairo In addition: Warning message: In (function (display = "", width, height, pointsize, gamma, bg, : unable to open connection to X11 display '' Calls: <Anonymous> -> dev.set -> <Anonymous>
Why does grid::grid.grabExpr try to open an X11 connection when it does not need one?
Context: some R code which absolutely should not depend on X11 connection fails to run when I shutdown my X11 server, and I would like to make the code robust towards this happening.
Bonus question: Run DISPLAY=XYZ R, then issue Sys.unsetenv("DISPLAY"); grid::grid.grabExpr(1). I am getting the same error. The only difference between 1. and 2. being set variable DISPLAY, why does unsetting DISPLAY not take me back to the result of 1?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
