R: 不能使用 0-cloud 来 install.packages [英] R: Cannot use 0-cloud to install.packages
问题描述
当我尝试从 0-cloud 安装软件包时,它不起作用
When I try to install packages from 0-cloud it doesn't work
> install.packages("lfactors")
--- Please select a CRAN mirror for use in this session ---
然后我从存储库列表中选择 0-cloud.和 R 返回
then I select 0-cloud from the list of repositories. and R returns
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.
有什么想法吗?
根据评论,我运行了这个
based on a comment, I ran this
capabilities()["libcurl"]
libcurl
TRUE
所以我认为不是那样.
推荐答案
您的 R 二进制文件可能是在没有 curl 支持的情况下构建的,并且您无法访问 https 服务器.看看这会返回什么:
Your R binary may have been built without curl support, and you cannot access https servers. See what this returns:
R> capabilities()["libcurl"]
libcurl
TRUE
R>
如果这对您来说是 FALSE
,请做两件事:
In case this is FALSE
for you, do two things:
更改
options("repos")
以使用 http 而不是 https.
Change
options("repos")
to use http instead of https.
重建 R 以获得 libcurl 支持.
Rebuild R to have libcurl support.
我在 Rprofile.site
中这样做:
## Example of Rprofile.site
local({
r <- getOption("repos")
r["CRAN"] <- "http://cran.rstudio.com" ## not https for you
options(repos = r)
})
另一种可能性,尤其是在 Windows 上,必须激活 internet2 dll,因此运行一次 setInternet2(TRUE)
应该会有所帮助.
Another possibility, particularly on Windows, is that the internet2 dll has to be activate, so running setInternet2(TRUE)
once should help.
这篇关于R: 不能使用 0-cloud 来 install.packages的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!