R包的安装错误ERROR: dependency ‘plyr’ is not available for package ‘reshape2’

我在ubuntu14.04上安装ggplot2的时候出现一下错误:

ERROR: dependency ‘plyr’ is not available for package ‘reshape2’
* removing ‘/home/wq/R/x86_64-pc-linux-gnu-library/3.0/reshape2’
Warning in install.packages :
  installation of package ‘reshape2’ had non-zero exit status
ERROR: dependency ‘plyr’ is not available for package ‘scales’
* removing ‘/home/wq/R/x86_64-pc-linux-gnu-library/3.0/scales’
Warning in install.packages :
  installation of package ‘scales’ had non-zero exit status
ERROR: dependencies ‘plyr’, ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/home/wq/R/x86_64-pc-linux-gnu-library/3.0/ggplot2’
Warning in install.packages :
  installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmpgbMDf6/downloaded_packages’
从头看,原来是plyr包没有安装,接下来安装plyr包,有
ERROR: dependency ‘plyr’ is not available for package ‘reshape2’
* removing ‘/home/wq/R/x86_64-pc-linux-gnu-library/3.0/reshape2’
Warning in install.packages :
  installation of package ‘reshape2’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmpgbMDf6/downloaded_packages’
最后我找到了解决办法,将包下载下来,然后自己安装。

去这个网站https://launchpad.net/ubuntu/vivid/+package/r-cran-plyr下载r-cran-plyr包,通过如下代码安装:

setwd("/path/where/I/downloaded/the/compressed/file")
install.packages("plyr", repos=NULL)
ggplot2就通过正常的安装(install.packages("ggplot2")就可以了


你可能感兴趣的:(R)