简体   繁体   English

在ubuntu上安装ggp​​lot2软件包

[英]installing ggplot2 package on ubuntu

I'm on ubuntu precise pangolin running inside a VM, using R 3.1 and Rstudio 0.98.507 and I'm unable to install ggplot2 我正在使用R 3.1和Rstudio 0.98.507在VM内运行的ubuntu精确穿山甲上运行,但无法安装ggp​​lot2

Here is the output : 这是输出:

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’

If you dont have a swap file enabled and run out of ram the OOM (out of memory) killer will normally terminate the offending process. 如果您没有启用交换文件并且用完了内存,OOM(内存不足)杀手通常会终止违规进程。 This exhibits itself in the manner described in the OP's question when attempting to install packages. 尝试安装软件包时,这以OP问题中描述的方式表现出来。 To fix this a swap file should be enabled. 要解决此问题,应启用交换文件。

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

$ mkswap /swapfile
$ swapon /swapfile

You can change attributes for the swap file like swappiness see an example here . 您可以更改交换文件的属性,例如swappiness,请参见此处的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM