简体   繁体   English

无法在R中加载ggplot2

[英]trouble loading ggplot2 in R

I'm having trouble loading ggplot2 using R version 2.12.1, as shown below. 我在使用R版本2.12.1加载ggplot2时遇到问题,如下所示。 The only help I can find suggests loading "proto". 我能找到的唯一帮助建议加载“ proto”。 I tried that and it didn't fix my problem. 我尝试了一下,但并没有解决我的问题。 Any help would be very much appreciated. 任何帮助将不胜感激。 Thanks, 谢谢,

peter l 彼得l

> install.packages('ggplot2', dep = TRUE)
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/leopard/contrib/2.12/ggplot2_0.8.9.tgz'
Content type 'application/x-gzip' length 2481399 bytes (2.4 Mb)
opened URL
=================================================
downloaded 2.4 Mb


The downloaded packages are in
    /var/folders/XF/XF0tU7gdGTeF4Th7KhKYDk+++TI/-Tmp-//RtmpFMnqLB/downloaded_packages
> library(ggplot2)
Error in assign(names[i], dots[[i]], env = envir) : 
  invalid first argument
Error : unable to load R code in package 'ggplot2'
Error: package/namespace load failed for 'ggplot2'

Hmmm, have you omitted some lines there, before the The downloaded packages are in.... ? 嗯,在The downloaded packages are in....之前,您在那儿省略了几行吗? I get: 我得到:

> install.packages('ggplot2', dep = TRUE)
Installing package(s) into ‘/home/gavin/R/libs’
(as ‘lib’ is unspecified)
trying URL 'http://cran.uk.r-project.org/src/contrib/ggplot2_0.8.9.tar.gz'
Content type 'application/x-gzip' length 2074749 bytes (2.0 Mb)
o    pened URL
==================================================
downloaded 2.0 Mb

* installing *source* package ‘ggplot2’ ...
** R
** data
**  moving datasets to lazyload DB
** inst
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded

* DONE (ggplot2)

The downloaded packages are in
    ‘/tmp/RtmpfDSoM8/downloaded_packages’
> require(ggplot2)
Loading required package: ggplot2
Loading required package: reshape
Loading required package: plyr

Attaching package: 'reshape'

The following object(s) are masked from 'package:plyr':

    round_any

Loading required package: grid
Loading required package: proto

Do you also see the * Done (ggplot2) message for example? 您还看到例如* Done (ggplot2)消息吗? If not, the installation likely failed for some reason and we need more details in order to help. 如果不是,安装可能由于某些原因而失败,我们需要更多详细信息以提供帮助。

The above was on 以上是

> sessionInfo()
R version 2.12.1 Patched (2011-02-06 r54249)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_GB.utf8       LC_NUMERIC=C             
 [3] LC_TIME=en_GB.utf8        LC_COLLATE=en_GB.utf8    
 [5] LC_MONETARY=C             LC_MESSAGES=en_GB.utf8   
 [7] LC_PAPER=en_GB.utf8       LC_NAME=C                
 [9] LC_ADDRESS=C              LC_TELEPHONE=C           
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C      

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets 
[7] methods   base     

other attached packages:
[1] ggplot2_0.8.9 proto_0.3-8   reshape_0.8.4 plyr_1.4     

loaded via a namespace (and not attached):
[1] tools_2.12.1

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

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