我在使用R版本2.12.1加载ggplot2时遇到问题,如下所示。我能找到的唯一帮助就是加载“proto”。我试过了,它没有解决我的问题。任何帮助将非常感谢。谢谢,
peter 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'
答案 0 :(得分:0)
嗯,你在The downloaded packages are in....
之前省略了一些行吗?我明白了:
> 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
您是否也看到了* Done (ggplot2)
消息?如果没有,安装可能由于某种原因失败,我们需要更多细节才能提供帮助。
以上是
> 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