阅读背景:

不能使用0-cloud来安装。包。

来源:互联网 

When I try to install packages from 0-cloud it doesn't work

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

> install.packages("lfactors")
--- Please select a CRAN mirror for use in this session ---

then I select 0-cloud from the list of repositories. and R returns

然后从存储库列表中选择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) 

But, when I run this code and select another repository it does work.

但是,当我运行这个代码并选择另一个存储库时,它确实起作用了。

I tried turning off my proxy server, and visiting the site with the proxy server on and I can visit it in the browser with no issue.

我试着关掉我的代理服务器,用代理服务器访问站点,我可以在浏览器中访问它,没有问题。

Any ideas?

什么好主意吗?

Edit: based on a comment, I ran this

编辑:基于评论,我运行了这个。

capabilities()["libcurl"]
libcurl 
   TRUE

So I think it's not that.

所以我认为不是这样的。

1 个解决方案

#1


5  

Your R binary may have been built without curl support, and you cannot access https servers. See what this returns:

您的R二进制文件可能是在没有curl支持的情况下构建的,您不能访问https服务器。看到这个回报:

R> capabilities()["libcurl"]
libcurl 
   TRUE 
R> 

In case this is FALSE for you, do two things:

如果这对你来说是假的,做两件事:

  1. Change options("repos") to use http instead of https.

    更改选项(“repos”)使用http而不是https。

  2. Rebuild R to have libcurl support.

    重建R以获得libcurl支持。

I do this in Rprofile.site:

我在Rprofile.site中这样做:

## Example of Rprofile.site
local({
    r <- getOption("repos")
    r["CRAN"] <- "https://cran.rstudio.com"    ## not https for you
    options(repos = r)
})

Edit: Another possibility, particularly on Windows, is that the internet2 dll has to be activate, so running setInternet2(TRUE) once should help.

编辑:另一种可能性,特别是在Windows上,是internet2 dll必须被激活,所以运行setInternet2(TRUE)应该会有帮助。


分享到: