当您尝试从GitHub的存储库安装某个R包时
install_github('rWBclimate', 'ropensci')
如果您有以下错误:
Installing github repo(s) rWBclimate/master from ropensci
Downloading rWBclimate.zip from https://github.com/ropensci/rWBclimate/archive/master.zip
Error in function (type, msg, asError = TRUE) :
Could not resolve host: github.com; Host not found, try again
显示此错误是因为R尝试通过代理在Intenet上访问。
答案 0 :(得分:73)
解
步骤1.安装devtools软件包
if (!require("devtools")) install.packages("devtools")
library(devtools)
步骤2.设置我们代理的配置(请更新您的信息代理)
library(httr)
set_config(
use_proxy(url="18.91.12.23", port=8080, username="user",password="password")
)
install_github('rWBclimate', 'ropensci')
答案 1 :(得分:0)