简体   繁体   English

安装ggp​​lot2软件包时出错

[英]Error while installing ggplot2 package

I am unable to install ggplot2 package. 我无法安装ggplot2软件包。 I tried running below code. 我尝试运行下面的代码。

install.packages("ggplot2")
 also installing the dependencies ‘stringi’, ‘colorspace’, ‘Rcpp’,     ‘stringr’, ‘munsell’, ‘plyr’, ‘digest’, ‘reshape2’, ‘scales’

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/stringi_1.0-1.zip'
Content type 'application/zip' length 14265659 bytes (13.6 MB)
downloaded 13.6 MB

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/colorspace_1.2-6.zip'
Content type 'application/zip' length 392857 bytes (383 KB)
downloaded 383 KB

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/Rcpp_0.12.2.zip'
Warning in install.packages :
InternetOpenUrl failed: 'The operation timed out'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
cannot open URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/Rcpp_0.12.2.zip'
Warning in install.packages :
 download of package ‘Rcpp’ failed
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/stringr_1.0.0.zip'
Content type 'application/zip' length 83159 bytes (81 KB)
downloaded 81 KB

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/munsell_0.4.2.zip'
Content type 'application/zip' length 125762 bytes (122 KB)
downloaded 122 KB

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/plyr_1.8.3.zip'
Warning in install.packages :
InternetOpenUrl failed: 'The operation timed out'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
cannot open URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/plyr_1.8.3.zip'
Warning in install.packages :
download of package ‘plyr’ failed
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/digest_0.6.8.zip'
Content type 'application/zip' length 151939 bytes (148 KB)
downloaded 148 KB

trying URL 

'http://cran.rstudio.com/bin/windows/contrib/3.2/reshape2_1.4.1.zip'
  Warning in install.packages :
  InternetOpenUrl failed: 'The operation timed out'
  Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/reshape2_1.4.1.zip'
  Warning in install.packages :
  download of package ‘reshape2’ failed
  trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/scales_0.3.0.zip'
  Warning in install.packages :
  InternetOpenUrl failed: 'The operation timed out'
  Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/scales_0.3.0.zip'
  Warning in install.packages :
  download of package ‘scales’ failed
  trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/ggplot2_1.0.1.zip'
  Warning in install.packages :
  InternetOpenUrl failed: 'The operation timed out'
  Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/ggplot2_1.0.1.zip'
  Warning in install.packages :
  download of package ‘ggplot2’ failed
  package ‘stringi’ successfully unpacked and MD5 sums checked
  package ‘colorspace’ successfully unpacked and MD5 sums checked
  package ‘stringr’ successfully unpacked and MD5 sums checked
  package ‘munsell’ successfully unpacked and MD5 sums checked
  package ‘digest’ successfully unpacked and MD5 sums checked

I tried installing the plyr package individually but I got the same error 我尝试单独安装plyr软件包,但出现相同的错误

InternetOpenUrl failed: 'The operation timed out' InternetOpenUrl失败:“操作超时”

while installing the dependency package Rcpp and plyr also failed 在安装依赖包Rcppplyr也失败

Try and see if the following syntax works for you: 尝试看看以下语法是否适合您:

install.packages("ggplot2", dependencies = TRUE, repos = "http://cran.rstudio.com/")

Mirror names can be changed via "repos". 镜像名称可以通过“ repos”进行更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM