R 在ubuntu上安装ggplot2软件包

R 在ubuntu上安装ggplot2软件包,r,R,我在虚拟机中运行ubuntu precise pangolin,使用R3.1和Rstudio 0.98.507,无法安装ggplot2 以下是输出: install.packages('ggplot2') Installing package into ‘/home/uwhpsc/R/i686-pc-linux-gnu-library/3.1’ (as ‘lib’ is unspecified) also installing the dependencies ‘colorspace’, ‘R

我在虚拟机中运行ubuntu precise pangolin,使用R3.1和Rstudio 0.98.507,无法安装ggplot2

以下是输出:

install.packages('ggplot2')

Installing package into ‘/home/uwhpsc/R/i686-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘colorspace’, ‘Rcpp’, ‘stringr’, ‘RColorBrewer’, ‘dichromat’, ‘munsell’, ‘labeling’, ‘plyr’, ‘digest’, ‘gtable’, ‘reshape2’, ‘scales’, ‘proto’

trying URL 'http://cran.rstudio.com/src/contrib/colorspace_1.2-4.tar.gz'
Content type 'application/x-gzip' length 242791 bytes (237 Kb)
opened URL
==================================================
downloaded 237 Kb

trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_0.11.1.tar.gz'
Content type 'application/x-gzip' length 2003515 bytes (1.9 Mb)
opened URL
==================================================
downloaded 1.9 Mb

trying URL 'http://cran.rstudio.com/src/contrib/stringr_0.6.2.tar.gz'
Content type 'application/x-gzip' length 20636 bytes (20 Kb)
opened URL
==================================================
downloaded 20 Kb

trying URL 'http://cran.rstudio.com/src/contrib/RColorBrewer_1.0-5.tar.gz'
Content type 'application/x-gzip' length 10656 bytes (10 Kb)
opened URL
==================================================
downloaded 10 Kb

trying URL 'http://cran.rstudio.com/src/contrib/dichromat_2.0-0.tar.gz'
Content type 'application/x-gzip' length 84320 bytes (82 Kb)
opened URL
==================================================
downloaded 82 Kb

trying URL 'http://cran.rstudio.com/src/contrib/munsell_0.4.2.tar.gz'
Content type 'application/x-gzip' length 91026 bytes (88 Kb)
opened URL
==================================================
downloaded 88 Kb

trying URL 'http://cran.rstudio.com/src/contrib/labeling_0.2.tar.gz'
Content type 'application/x-gzip' length 9998 bytes
opened URL
==================================================
downloaded 9998 bytes

trying URL 'http://cran.rstudio.com/src/contrib/plyr_1.8.1.tar.gz'
Content type 'application/x-gzip' length 393233 bytes (384 Kb)
opened URL
==================================================
downloaded 384 Kb

trying URL 'http://cran.rstudio.com/src/contrib/digest_0.6.4.tar.gz'
Content type 'application/x-gzip' length 79309 bytes (77 Kb)
opened URL
==================================================
downloaded 77 Kb

trying URL 'http://cran.rstudio.com/src/contrib/gtable_0.1.2.tar.gz'
Content type 'application/x-gzip' length 19667 bytes (19 Kb)
opened URL
==================================================
downloaded 19 Kb

trying URL 'http://cran.rstudio.com/src/contrib/reshape2_1.4.tar.gz'
Content type 'application/x-gzip' length 34121 bytes (33 Kb)
opened URL
==================================================
downloaded 33 Kb

trying URL 'http://cran.rstudio.com/src/contrib/scales_0.2.4.tar.gz'
Content type 'application/x-gzip' length 40093 bytes (39 Kb)
opened URL
==================================================
downloaded 39 Kb

trying URL 'http://cran.rstudio.com/src/contrib/proto_0.3-10.tar.gz'
Content type 'application/x-gzip' length 530758 bytes (518 Kb)
opened URL
==================================================
downloaded 518 Kb

trying URL 'http://cran.rstudio.com/src/contrib/ggplot2_0.9.3.1.tar.gz'
Content type 'application/x-gzip' length 2330942 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb


The downloaded source packages are in
    ‘/tmp/Rtmpi3YRSS/downloaded_packages’
> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’

如果您没有启用交换文件并耗尽ram,OOM(内存不足)杀手通常会终止有问题的进程。当试图安装软件包时,它会以OP问题中描述的方式展示自己。要修复此问题,应启用交换文件

$ dd if=/dev/zero of=/swapfile bs=1024 count=512k

$ mkswap /swapfile
$ swapon /swapfile

您可以更改交换文件的属性,如交换。请参见示例。

Ubuntu正在虚拟机(虚拟盒)上运行。您有交换文件吗?执行swapon-s后,您可以使用
$swapon-s
进行检查。我似乎没有交换文件。添加一个交换文件可以对其进行排序。它现在可以工作了,谢谢。