问题
The rgl
package is developed on R-forge at https://r-forge.r-project.org/projects/rgl/. The simplest way to install the latest version should be
install.packages(\"rgl\", repos=\"http://R-Forge.R-project.org\")
but this often fails, as R-forge does not always have current builds. How do you get it then?
回答1:
There are two alternatives.
The simplest way is probably to install from Github, using
devtools::install_github("rforge/rgl", subdir="pkg/rgl")
EDITED TO ADD: For a while this didn't work, as the Github mirror was not being updated. It seems fine again now, but if it dies again, the only one of the three methods described in this answer that still works is the one using svn.
This installs a version that may be a few hours old. It does require that you have the tools for a source install; rgl
has a lot of code that needs to be compiled. Those tools are available for Windows at https://cloud.r-project.org/bin/windows/Rtools/. OSX installs require XCode and XQuartz and perhaps some other packages. Linux users will need to install a number of libraries as well.
An alternative way (the only one of the three described here that still works) is to check out the source tree from SVN using
svn checkout svn://svn.r-forge.r-project.org/svnroot/rgl/
You can also check out from the Github mirror using
git clone https://github.com/rforge/rgl.git
The rgl
sources will be in the rgl/pkg/rgl subdirectory. Then you can install it using
R CMD INSTALL rgl
(provided all the prerequisites exist).
来源:https://stackoverflow.com/questions/37142762/how-do-i-install-the-latest-version-of-rgl