目录
问题描述
> install.packages('ggplot2')
Installing package into ‘/***/***/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://cran.rstudio.com/src/contrib:
cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'
Warning message:
package ‘ggplot2’ is not available (for R version 3.6.1)
Warning: unable to access index for repository
package not available
修改~/.Rprofile
或者chooseCRANmirror()
换源不能解决问题
原因
~/.Renviron
内容如下(此处隐去IP):
http_proxy="http://***.***.**.**:22"
https_proxy="http://***.***.**.**:22"