使用镜像加速 Rtools 下载与安装
在 windows 使用 R,尤其是安装 R 包的时候,经常会遇到一些 Rtools 的问题,今天聊一下。
Rtools 是什么
Rtools 作用很大,但我们一般不怎么会直接使用。
Rtools provides a toolchain for Windows platform that work well with R. It mainly includes GNU make, GNU gcc, and other utilities commonly used on UNIX-ish platform. R statistical language & environment is that it is open source and cross-platform.
Rtools 安装
在 RStudio 中安装shiny
包的时候,就出现了要安装 Rtools 的 warning,提示信息中还给出了下载的链接地址。但问题是 https://cran.rstudio.com/bin/windows/Rtools/ 是位于国外的服务器,下载速度慢的令人发指。

方法一
使用清华大学的 CRAN 镜像下载 Rtools,镜像地址:https://mirrors.tuna.tsinghua.edu.cn/CRAN/,如果你记不住这一串常常地址,可以从 CRAN 官网点击进去。

在清华大学的 CRAN 页面选择 Download R for Windows,在出现的 R for Windows 页面选择 Rtools:




当我们通过下面的链接直接访问清华大学 CRAN 的 Rtools 时:
https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/Rtools/
这里面有一个问题需要注意,即点击 "this page" 访问 R 其他版本对应的 Rtools 时会默认跳转到 CRAN 官网默认的页面!!!
https://cran.r-project.org/bin/windows/Rtools/history.html
this page 指向异常
正常情况下应该是跳转到清华大学的 Rtools history 页面才对!!!
https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/Rtools/history.html

方法二
第二种方法,我是在网络上看到,大家也可以参考一下。
options("repos"=c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
install.packages('installr')
library(installr)
install.Rtools()
这是通过设置清华大学 CRAN 后,先安装installr
包,再通过这个包直接下载安装 Rtools,速度上同样也是杠杠的。


本文分享自微信公众号 - 生信科技爱好者(bioitee)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。