Installing the "rgl" package in R, Mac OSX El Captian

I am new to programming in R, so I apologize in advance if I seem naive. I want to be able to analyze the main components in my data in 3D. I read that the "pca3d" function is good for this, but I need to download the "rgl" library. When I use install.packages, it asks:

install.packages("rgl") There is a binary version available but the source version is later: binary source needs_compilation rgl 0.95.1201 0.95.1367 TRUE Do you want to install from sources the package which needs compilation? y/n: n 

I tried to install it both binary and source, but nothing works. If I try to download the binary version, I get this error:

 Error : .onLoad failed in loadNamespace() for 'rgl', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so': dlopen(/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so, 6): Library not loaded: /opt/X11/lib/libGLU.1.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so Reason: image not found Error: package or namespace load failed for 'rgl' 

If I say yes to install from source, I get the following error:

 configure: error: X11 not found but required, configure aborted. ERROR: configuration failed for package 'rgl' * removing '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl' * restoring previous '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl' Warning in install.packages : installation of package 'rgl' had non-zero exit status 

I was looking for hours on how to do this work, so if someone can work out how I should install the rgl package, then I would be very grateful!

Thanks Claire

+7
r osx-elcapitan macos rgl
source share
3 answers

After talking with a colleague, all I had to do was download XQuartz from here to install X11, and then install the original package again. Now it works!

+7
source share

Downloading XQuartz completely solved everything after I spent several hours trying to come up with a solution to this problem.

+2
source share

First I downloaded the package to my desktop, but R gave me the same error, this is what worked for my Mac:

install.packages ("rgl", lib = "Desktop / rgl_0.96.0 (1) .tgz") Warning in install.packages packages: 'lib = "Desktop / rgl _0.96.0 (1) .tgz"' is not available for recording Instead you want to use a personal library? (G / l) Y Create a personal library ~ / Library / R / 3.3 / library install packages? (G / l) y

+2
source share

All Articles