'`rgl` crashes R 4.2.0 in RStudio

The new release of R version 4.2.0 will crash when loading the rgl package if in RStudio. What can I do about it?



Solution 1:[1]

This is a bug in the startup code that was introduced in 0.100.50 and fixed in release 0.108.3.2. If you're using a version that has the bug, a workaround is to run options(rgl.debug = TRUE) before starting rgl. For example, you could put that line in your .Rprofile.

The background was that some Unix systems print spurious error messages on startup, so rgl directed those to the nul device. If you wanted to see them, you could set options(rgl.debug = TRUE). But what's new is that the nul device sometimes fails to open in Windows. rgl wasn't checking for that, but now it does.

See https://github.com/rstudio/rstudio/issues/11043 for more discussion.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1