Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 安装.程序包(“ggplot2”)不工作_R_Ggplot2_Dependencies - Fatal编程技术网

R 安装.程序包(“ggplot2”)不工作

R 安装.程序包(“ggplot2”)不工作,r,ggplot2,dependencies,R,Ggplot2,Dependencies,我使用的是R版本3.0.2(2013-09-25)-“飞盘航行” 尝试在R上安装ggplot2时,出现以下错误: install.packages("ggplot2") Installing package into ‘/home/alex/R/x86_64-pc-linux-gnu-library/3.0’ (as ‘lib’ is unspecified) Warning: dependencies ‘MASS’, ‘plyr’ are not available also installi

我使用的是R版本3.0.2(2013-09-25)-“飞盘航行”

尝试在R上安装ggplot2时,出现以下错误:

install.packages("ggplot2")
Installing package into ‘/home/alex/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning: dependencies ‘MASS’, ‘plyr’ are not available
also installing the dependency ‘reshape2’

trying URL 'http://cran.sciserv.eu/src/contrib/reshape2_1.4.1.tar.gz'
Content type 'application/x-gzip' length 34693 bytes (33 Kb)
opened URL
==================================================
downloaded 33 Kb

trying URL 'http://cran.sciserv.eu/src/contrib/ggplot2_1.0.1.tar.gz'
Content type 'application/x-gzip' length 2351203 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb

* installing *source* package ‘reshape2’ ...
** package ‘reshape2’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG   -I"/home/alex/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/include"   -fpic  -O3 -pipe  -g  -c RcppExports.cpp -o RcppExports.o
g++ -I/usr/share/R/include -DNDEBUG   -I"/home/alex/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/include"   -fpic  -O3 -pipe  -g  -c melt.cpp -o melt.o
g++ -shared -o reshape2.so RcppExports.o melt.o -L/usr/lib/R/lib -lR
installing to /home/alex/R/x86_64-pc-linux-gnu-library/3.0/reshape2/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace ‘plyr’ 1.8 is being loaded, but >= 1.8.1 is required
ERROR: lazy loading failed for package ‘reshape2’
* removing ‘/home/alex/R/x86_64-pc-linux-gnu-library/3.0/reshape2’
ERROR: dependencies ‘reshape2’, ‘MASS’ are not available for package ‘ggplot2’
* removing ‘/home/alex/R/x86_64-pc-linux-gnu-library/3.0/ggplot2’

The downloaded source packages are in
    ‘/tmp/RtmpIesHFE/downloaded_packages’
Warning messages:
1: In install.packages("ggplot2") :
  installation of package ‘reshape2’ had non-zero exit status
2: In install.packages("ggplot2") :
  installation of package ‘ggplot2’ had non-zero exit status
> 
有人能帮忙解决这些错误吗?我在谷歌上搜索并尝试安装依赖项,但似乎没有任何效果。
提前感谢。

我的设置与您的设置几乎完全相同,并且:

install.packages("plyr", repos="http://cran.rstudio.com/")
install.packages("ggplot2", repos="http://cran.rstudio.com/")
对我来说还不错。试一试,如果仍然不起作用,请尝试另一面镜子:

install.packages("plyr", repos="http://cran.cnr.Berkeley.edu/")
install.packages("ggplot2", repos="http://cran.cnr.Berkeley.edu/")

尝试另一个CRAN镜像。如果可能,您可能还希望更新到R的最新版本。您的镜像只落后9小时(这很好),并且正在显示,尽管看起来您的R没有看到它。请尝试显式安装
plyr
,并确保其版本为1.8.2。您现在落后两个二级版本,因此CRAN二进制文件可能不匹配。你真的应该更新。