解。 有代理时如何install_github
当你尝试从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。
解
第1步。安装devtools包
if (!require("devtools")) install.packages("devtools") library(devtools)
第2步。为我们的代理设置configuration(请更新您的信息代理)
library(httr) set_config( use_proxy(url="18.91.12.23", port=8080, username="user",password="password") ) install_github('rWBclimate', 'ropensci')