如何处理curl :: curl_fetch_memory(url,handle = h)中的错误?设置代理也无济于事

时间:2019-04-09 04:47:12

标签: r windows curl proxy installation

在Windows PC上更新R版本后,我无法安装github软件包。这是公司设置中的工作场所PC。 R版本已更新,没有管理权限。我已经通过anaconda安装了Rstudio。 Rstudio工作正常,我也可以从cran安装软件包。但是下面的代码不起作用。

 library(devtools)
 install_github("hadley/dplyr")
Error in curl::curl_fetch_memory(url, handle = h) : 
  Timeout was reached: Resolving timed out after 10000 milliseconds

我尝试使用

设置代理
library(httr)
set_config(
   use_proxy(url="xxxx", port=yyyy)
 )

但是它仍然不起作用。httr::GET("api.github.com")的输出如下

Response [https://api.github.com/]
  Date: 2019-04-09 04:45
  Status: 200
  Content-Type: application/json; charset=utf-8
  Size: 2.16 kB
{
  "current_user_url": "https://api.github.com/user",
  "current_user_authorizations_html_url": "https://github.com/settings/connections/applications{/client_id}",
  "authorizations_url": "https://api.github.com/authorizations",
  "code_search_url": "https://api.github.com/search/code?q={query}{&page,per_page,sort,order}",
  "commit_search_url": "https://api.github.com/search/commits?q={query}{&page,per_page,sort,order}",
  "emails_url": "https://api.github.com/user/emails",
  "emojis_url": "https://api.github.com/emojis",
  "events_url": "https://api.github.com/events",
  "feeds_url": "https://api.github.com/feeds",
...

0 个答案:

没有答案