How do I install the R package rgl on Ubuntu 9.10, using R version 2.12.1?

你说的曾经没有我的故事 提交于 2019-11-28 20:54:26

I had to deal with this problem many times, and this always worked just fine: type in a terminal

sudo apt-get install libglu1-mesa-dev

After this I just start R and install the rgl package with the install.packages function

In case any newbies like myself have the same or similar issues installing rgl, the following finally worked for me.

1) At the bash prompt:

sudo apt-get build-dep r-cran-rgl

This fixes "missing required header GL/gl.h" issues (I still had one after installing libglu1-mesa-dev).

2) At the R prompt (I started R with 'sudo R' but that probably isn't required):

install.packages("rgl", repos="http://R-Forge.R-project.org")

which downloads, compiles, and installs the latest version.

I also tried sudo apt-get install r-cran-rgl at step 2), but whenever I tried library(rgl) within R it would complain with

Error: package ‘rgl’ was built before R 3.0.0: please re-install it

But rgl can be upgraded from this point using the update.packages() command in R. This might be preferable if you want apt-get to know it's installed, but I didn't really care since R provides it's own package-management tools.

You probably need to be doing this with R 2.13.1. The linking points are probably different. If you really insist on using an old version, you need to compile with a version of rgl that matches that version. There is an Archive of prior versions and the link is at the bottom of the Contributed Packages page at the CRAN website.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!