Installing "rgl" package in R, Mac OSX El Captian [fixed]

I'm new to programming in R so I apologise in advance if I seem naive. I want to be able to do some principle components analysis on my data in 3D. I read that the "pca3d" function is good for this...