R:无法使用0-cloud安装0.5个软件包

R:无法使用0-cloud安装0.5个软件包,r,rstudio,R,Rstudio,当我尝试从0-cloud安装软件包时,它不起作用 > install.packages("lfactors") --- Please select a CRAN mirror for use in this session --- 然后我从存储库列表中选择0-cloud。和R返回 Warning: unable to access index for repository https://cran.rstudio.com/src/contrib Warning: unable to ac

当我尝试从0-cloud安装软件包时,它不起作用

> install.packages("lfactors")
--- Please select a CRAN mirror for use in this session ---
然后我从存储库列表中选择0-cloud。和R返回

Warning: unable to access index for repository https://cran.rstudio.com/src/contrib
Warning: unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/3.2
Warning message:
package ‘lfactors’ is not available (for R version 3.2.1) 
但是,当我运行此代码并选择另一个存储库时,它确实可以工作

我尝试关闭代理服务器,并在打开代理服务器的情况下访问该站点,我可以在浏览器中访问该站点,而不会出现任何问题

有什么想法吗

编辑: 根据评论,我运行了这个

capabilities()["libcurl"]
libcurl 
   TRUE

所以我认为不是这样。

您的R二进制文件可能是在没有curl支持的情况下构建的,并且您无法访问https服务器。看看这会带来什么:

R> capabilities()["libcurl"]
libcurl 
   TRUE 
R> 
如果这对您来说是错误的,请做两件事:

将选项repos更改为使用http而不是https

重建R以获得libcurl支持

我在Rprofile.site中执行此操作:


编辑:另一种可能性,特别是在Windows上,是必须激活internet2 dll,因此运行setInternet2TRUE一次应该会有所帮助。

我编辑了这个问题,但看起来不是这样。我有一个由R团队构建的Windows二进制文件。我明白了,你能在install.packages调用之前尝试setInternet2TRUE吗?IIRC它支持libcurl需要的东西。这也是Windows下一个R版本的默认设置。看例句。如果这个答案暗示了这一点,我就把它标记为答案。我不确定论坛礼仪是怎么说的,我应该编辑它吗?我能做到,我很感激你先问:
## Example of Rprofile.site
local({
    r <- getOption("repos")
    r["CRAN"] <- "http://cran.rstudio.com"    ## not https for you
    options(repos = r)
})