使用镜像加速 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/ 是位于国外的服务器,下载速度慢的令人发指。

9cc7e8b3-688b-4586-a9bc-b2117e68befc.png

方法一

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

a98a5bc4-e47f-4b97-a286-82fdc395fe75.png

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

3c77f36b-8c4d-4f5c-8ddd-b7dd9ee09b81.png


220b009e-47d7-458e-ace7-cbd96ef1bf21.png
在 Rtools 选择下载最新版本的 Rtools,或者下载 R 版本对应 Rtools:
54eccd0a-daaa-480a-b8a5-206cae7da7bc.png


dd754940-6bd2-4133-962b-c2c5bb736b85.png


✎ 注意


当我们通过下面的链接直接访问清华大学 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

61c6e906-dfb4-4611-ba51-3e36c99d098a.png

this page 指向异常


正常情况下应该是跳转到清华大学的 Rtools history 页面才对!!!

  • https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/Rtools/history.html 

最后,安装 Rtools,这没什么好说的,按照默认设置一路 Next 下去,最后就安装成功,这里只强调一点是把勾选添加 rtools 到环境变量中。
b4729488-df48-42b6-af1b-baa07b4450d7.png


方法二

第二种方法,我是在网络上看到,大家也可以参考一下。

options("repos"=c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
install.packages('installr')
library(installr)
install.Rtools()

这是通过设置清华大学 CRAN 后,先安装installr包,再通过这个包直接下载安装 Rtools,速度上同样也是杠杠的。


8ae107df-428f-489d-bb9f-a65c641e4c68.png — END—

2383dd72-387d-42c1-bd6e-c6d27328ed07.png


01cc030c-3a53-4d92-a0fe-f39dd9ce9b64.gif 戳原文,更有料!

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

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值