安装软件包时出错

时间:2018-07-04 11:39:20

标签: r ggplot2 install

我无法在R studio上安装任何软件包。特别是我正在为“ ggplot2”执行此操作。我还想提到我在Windows中工作。

每当我运行代码

install.packages("ggplot2")

我在控制台中收到错误

> install.packages("ggplot2")
Warning in install.packages :
unable to access index for repository https://CRAN.R-project.org/src/contrib:
cannot open URL 'https://CRAN.R-project.org/src/contrib/PACKAGES'
Installing package into ‘C:/Users/Yash/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
unable to access index for repository https://CRAN.R-project.org/src/contrib:
cannot open URL 'https://CRAN.R-project.org/src/contrib/PACKAGES'
Warning in install.packages :
package ‘ggplot2’ is not available (for R version 3.5.0)
Warning in install.packages :
unable to access index for repository https://CRAN.R- 
project.org/bin/windows/contrib/3.5:
cannot open URL 'https://CRAN.R-project.org/bin/windows/contrib/3.5/PACKAGES'

我还尝试了两个代码

options(repos="https://CRAN.R-project.org")

install.packages("ggplot2", repos="https://cran.rstudio.com/")

他们也没有工作。它们也显示相同的错误。我认为我面临目录问题,但不确定。任何帮助将不胜感激。

0 个答案:

没有答案