我正在运行一个 ubuntu 12.04 实例,并加载了 R3.0.2,但无法获取 install.packages() 来安装软件包。它下载文件,但似乎没有安装它们。我在这里错过了什么吗?在运行 ubuntu R 实例之前,我从来没有遇到过这个问题。顺便说一句,我尝试以 root 身份运行该进程,从命令行使用 sudo R 实例化,但仍然没有警告,也没有安装。顺便说一句,这个问题在我尝试安装的所有软件包中都是一致的。
这是一个例子:
> install.packages("dataview")
Installing package into ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
also installing the dependency ‘xtermStyle’
trying URL 'http://cran.rstudio.com/src/contrib/xtermStyle_2.2-4.tar.gz'
Content type 'application/x-gzip' length 15265 bytes (14 Kb)
opened URL
==================================================
downloaded 14 Kb
trying URL 'http://cran.rstudio.com/src/contrib/dataview_1.4-8.tar.gz'
Content type 'application/x-gzip' length 10696 bytes (10 Kb)
opened URL
==================================================
downloaded 10 Kb
The downloaded source packages are in
‘/tmp/Rtmp6FevA0/downloaded_packages’
> library(dataview)
Error in library(dataview) : there is no package called ‘dataview’
为了它的价值,我使用以下 shell 命令安装了 R
#remove old versions
sudo apt-get remove r-base-core
#Adding deb to sources.list
sudo nano /etc/apt/sources.list
deb http://cran.rstudio.com/bin/linux/ubuntu precise/
# Add key to sign CRAN packages
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
#Add specific PPA to the system
sudo add-apt-repository ppa:marutter/rdev
sudo apt-get update
sudo apt-get upgrade
#installing
sudo apt-get install r-base
sudo apt-get install r-base-dev
预先感谢您的任何帮助。