I installed the rgl package (0.104.16) in R (3.6.3), but it does not load. I don't get any errors. It just never ends loading. I tried reinstalling R and RStudio and also Xquartz. Nothing is working. I have Mac OS Catalina version 10.15.7. Any help would be highly appreciated! Cheers
Package rgl in R not loading in Mac OS
17.6k Views Asked by Nolozz At
2
Edited to add new details and suggested fixes.
This appears to be due to problems in the 2.8.0beta version of Xquartz that was released in early February. There are two problems:
It makes incompatible changes to
libX11.6.dylib
, so programs (like the CRAN binaries ofrgl
) that were built for the 2.7.11 release will not work. If you buildrgl
(and everything else that uses X11) from source, it may be okay -- it was for me.When you uninstall it, it leaves behind two programs that run at startup:
/Library/LaunchDaemons/org.xquartz.startx.plist
(runs when you reboot your system) and/Library/LaunchAgents/org.xquartz.startx.plist
(runs when you login). If you then install 2.7.11, these will fail to run (probably because of the libX11 change mentioned above). At that point, nothing in X11 works.So the solution appears to be:
Applications/Utilities
folder to the trash.rgl
by runningremove.packages("rgl")
in R.org.xquartz.startx.plist
from/Library/LaunchDaemons
and/Library/LaunchAgents
.rgl
either from CRAN or from source.If I'm wrong and that process doesn't work, this will almost certainly work as long as your
rgl
version is at least 0.105.12 (but won't give you anyrgl
windows):To see your displays, run the
rglwidget()
function, and they'll display in a browser or the RStudio viewer pane.