当您尝试从GitHub的存储库安装一些R包时
install_github('rWBclimate', 'ropensci')
Run Code Online (Sandbox Code Playgroud)
如果您有以下错误:
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
Run Code Online (Sandbox Code Playgroud)
显示此错误是因为R尝试通过代理在Intenet上访问.
Gui*_*tos 74
解
步骤1.安装devtools包
if (!require("devtools")) install.packages("devtools")
library(devtools)
Run Code Online (Sandbox Code Playgroud)
步骤2.为我们的代理设置配置(请更新您的信息代理)
library(httr)
set_config(
use_proxy(url="18.91.12.23", port=8080, username="user",password="password")
)
install_github('rWBclimate', 'ropensci')
Run Code Online (Sandbox Code Playgroud)
如果设置代理配置不起作用(就像我的情况一样),可以将包从 github 下载到本地计算机:
解压文件夹并从本地计算机安装它:
devtools::install("C:/path/to/folder/ggbiplot-master")
Run Code Online (Sandbox Code Playgroud)