转自:http://blog.csdn.net/earl211/article/details/48224939
我在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) 备注:install.packages()命令的第一个参数应该改成压缩包的名称才能正确安装!!! intall.packages("r-cran-plyr_1.8.1.orig.tar.gz",repos=NULL)
ggplot2就通过正常的安装(install.packages("ggplot2")就可以了