1. 程式人生 > >R包的安裝錯誤ERROR: dependency ‘plyr’ is not available for package ‘reshape2’

R包的安裝錯誤ERROR: dependency ‘plyr’ is not available for package ‘reshape2’

轉自:http://blog.csdn.net/earl211/article/details/48224939

我在ubuntu14.04上安裝ggplot2的時候出現一下錯誤:

[plain] view plaincopyprint?
  1. ERROR: dependency ‘plyr’ is not available for package ‘reshape2’  
  2. * removing ‘/home/wq/R/x86_64-pc-linux-gnu-library/3.0/reshape2’  
  3. Warning in install.packages :  
  4.   installation of package ‘reshape2’ had non-zero exit status  
  5. ERROR: dependency ‘plyr’ is not available for package ‘scales’  
  6. * removing ‘/home/wq/R/x86_64-pc-linux-gnu-library/3.0/scales’  
  7. Warning in install.packages :  
  8.   installation of package ‘scales’ had non-zero exit status  
  9. ERROR: dependencies ‘plyr’, ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’  
  10. * removing ‘/home/wq/R/x86_64-pc-linux-gnu-library/3.0/ggplot2’  
  11. Warning in install.packages :  
  12.   installation of package ‘ggplot2’ had non-zero exit status  
  13. The downloaded source packages are in  
  14.     ‘/tmp/RtmpgbMDf6/downloaded_packages’  
從頭看,原來是plyr包沒有安裝,接下來安裝plyr包,有 [plain] view plaincopyprint?
  1. ERROR: dependency ‘plyr’ is not available for package ‘reshape2’  
  2. * removing ‘/home/wq/R/x86_64-pc-linux-gnu-library/3.0/reshape2’  
  3. Warning in install.packages :  
  4.   installation of package ‘reshape2’ had non-zero exit status  
  5. The downloaded source packages are in  
  6.     ‘/tmp/RtmpgbMDf6/downloaded_packages’  
最後我找到了解決辦法,將包下載下來,然後自己安裝。 [plain] view plaincopyprint?
  1. setwd("/path/where/I/downloaded/the/compressed/file")  
  2. install.packages("plyr", repos=NULL) 
  3. 備註:install.packages()命令的第一個引數應該改成壓縮包的名稱才能正確安裝!!!
  4. intall.packages("r-cran-plyr_1.8.1.orig.tar.gz",repos=NULL) 
ggplot2就通過正常的安裝(install.packages("ggplot2")就可以了