警告:需要 Rtools

Warning: Rtools is required

每次我安装包时都会出现此警告:警告:构建 R 包需要 Rtools,但当前未安装。请在继续之前下载并安装合适版本的 Rtools:

我使用 R-Studio 已有 4 个月了,之前从未遇到过此警告。尽管每次安装成功都会收到此警告。

从这里开始:missing Rtools, should I be worried?

This means that if you are going to install packages that need compilation, you also have to install Rtools in your system.

https://cran.r-project.org/bin/windows/Rtools/

我想翻译 https://blog.csdn.net/weixin_42098685/article/details/105864543 的革命措施。

第一步: 为您的 R 下载并安装正确的 Rtools。 第二步:
告诉 Rstudio Rtools 的安装位置。 使用此命令(## 之间的句子):

 writeLines('PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"',con="~/.Renviron") 

它应该 运行 作为管理员。

最后: 在##之间输入句子检查是否成功:

 Sys.which("make")

如果您看到路径而不是空白,则表示它已成功。 像这样