无法从github安装R-package
我正在尝试从github安装一个FlowCutter包(指向该包的链接:)。我使用的是R版本3.3.1(2016-06-21)。 我尝试过以下代码:无法从github安装R-package,r,curl,devtools,rcurl,install.packages,R,Curl,Devtools,Rcurl,Install.packages,我正在尝试从github安装一个FlowCutter包(指向该包的链接:)。我使用的是R版本3.3.1(2016-06-21)。 我尝试过以下代码: devtools::install\u github(“RGLab/flowIncubator”)&获取此错误: Error in curl::curl_fetch_disk(url, x$path, handle = handle) : Timeout was reached > traceback() 1
devtools::install\u github(“RGLab/flowIncubator”)
&获取此错误:
Error in curl::curl_fetch_disk(url, x$path, handle = handle) :
Timeout was reached
> traceback()
12: .Call(R_curl_fetch_disk, url, handle, path, "wb", nonblocking)
11: curl::curl_fetch_disk(url, x$path, handle = handle)
10: request_fetch.write_disk(req$output, req$url, handle)
9: request_fetch(req$output, req$url, handle)
8: request_perform(req, hu$handle$handle)
7: httr::GET(url, path = path, httr::write_disk(path = tmp))
6: remote_package_name.github_remote(remote)
5: remote_package_name(remote)
4: FUN(X[[i]], ...)
3: vapply(remotes, install_remote, ..., FUN.VALUE = logical(1))
2: install_remotes(remotes, quiet = quiet, ...)
1: devtools::install_github("RGLab/flowIncubator")
我尝试过更新devtools和curl这两个软件包,尝试过将R更新到旧版本,尝试过下载.zip文件并通过R studio安装,然后从库中加载该软件包。我还尝试直接将包文件放入库中。
我使用了函数install.packages(),但无法安装它 我发现了问题所在。似乎我的DNS服务器非常慢,这导致超时问题
切换到另一个DNS服务器(如谷歌)解决了这个问题 发生此错误的一个实例是当您在防火墙后面时。绕过此问题的一种方法是手动下载并安装软件包
# 1. Find the location where R saves installed packages:
libpath <- .libPaths()
# 2. On the Github webpage of the package you want to install,
## in the top right corner click on "Clone or download",
## then click "Download ZIP", save it, unzip it,
## and place it in the `libpath` directory identified in the previous step.
# 3. In R, set the working directory to `libpath`
setwd(libpath[1])
#4. Install and load the package manually using the `install()` function of
# the `devtools` package:
install("flowIncubator")
library(flowIncubator)
#1。查找R保存已安装软件包的位置:
libpath可能存在防火墙问题。我不确定,但是你可以下载存储库作为zip文件,解压缩它,然后在上面运行R CMD INSTALL
。我在Ubuntu 16.04上遇到了类似的问题。你在运行什么操作系统?正如@Yihui所说,一个解决办法是手动安装该软件包。如果您使用的是R studio,您可以下载主zip,在R工作目录中解压,然后发布安装(“FlowCutter”)
。它会将文件夹识别为软件包并正确安装。除此之外,我真的很想弄清这个问题的真相。