gpt4 book ai didi

r - 解决方案。有代理时如何install_github

转载 作者:行者123 更新时间:2023-12-03 06:13:34 27 4
gpt4 key购买 nike

当您尝试从 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 步:为我们的代理设置配置(请更新您的代理信息)

library(httr)
set_config(
use_proxy(url="18.91.12.23", port=8080, username="user",password="password")
)
install_github('rWBclimate', 'ropensci')

关于r - 解决方案。有代理时如何install_github,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17783686/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com