This is how I solved it:

  1. By looking at my PATH variable, which you get through

Sys.getenv("PATH")

I saw that it pointed rtools to c:\rtools40\. However, this should be c:\rtools40\usr\bin. I edited the environment Variable accordingly. Here is an instruction how to edit the environment variables on windows.

  1. I also added this to the .Renviron file:

PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"

The .Renviron file should be created/located accordingly to this location

Sys.getenv("HOME")
Answer from four-eyes on Stack Overflow
🌐
OHDSI
ohdsi.github.io › Hades › rSetup.html
Setting up the R environment
The easiest way to edit your .Renviron file is by using the usethis package again: ... This will open .Renviron in a text editor. Add the line with your PAT, save the file, and restart R.
🌐
R Project
cran.r-project.org › bin › windows › Rtools
RTools: Toolchains for building R and R packages from source on Windows
RTools: Toolchains for building R and R packages from source on Windows · Choose your version of Rtools:
🌐
R Project
cran.r-project.org › bin › windows › Rtools › rtools40.html
Using Rtools4 on Windows
Sys.which("make") ## "C:\\rtools40\\usr\\bin\\make.exe" ... If this succeeds, you’re good to go!
🌐
GitHub
github.com › jalvesaq › Vim-R › issues › 362
Can't seem to set rtools path in Windows · Issue #362 · jalvesaq/Vim-R
September 28, 2018 - Trying to use this at work on a Windows 7 machine. Our IT dept refuse to save Rtools at C:\rtools - so it's saved in C:\Program Files\rtools. I have included in intit.vim: let Rtools_path = &qu...
Author   jalvesaq
🌐
R Project
cran.r-project.org › bin › windows › Rtools › rtools43 › rtools.html
Rtools43 for Windows
Rtools43 is also available in base and full toolchain tarballs suitable for users who have their own installation of Msys2. The base toolchain tarball is smaller and includes only what is needed to build R and the recommended packages.
🌐
Bioinformatics for Beginners
bioinformatics.ccr.cancer.gov › docs › rtools › R and RStudio › 2.5_installing_r_on_windows
Installing R, RStudio, and Rtools on Windows - R and RStudio
Select "base" or "install R for the first time" - both of these options will take you to the same page · If using Firefox then click on the down error on the top right corner of the browser window to see the downloaded file · If using Internet Explorer then there will be a box at the bottom ...
🌐
Medium
lara-southard.medium.com › migrating-libraries-in-r-9780f2d6b145
Migrating Libraries in R (process credit to RBloggers) | by Lara Southard, PhD | Medium
November 28, 2022 - Note: you have to install devtools before Rtools and make sure you’re saving Rtools in the file path shown on the installation guide. Next, I’m following the guide in the link above. Here you want to save all of your packages using the function installed.packages() and write it to a file (in this case a .csv) so you can bring it into your new environment/device.
Find elsewhere
🌐
Alphacentauric
alphacentauric.com › post › r-installation-rstudio-rtools-guide
How to Install R, Rtools, and RStudio for Efficient R Programming
September 21, 2024 - In the Edit Environment Variable window, click "New" and add the path to the "bin" folder of your Rtools installation (e.g., `C:\Rtools\bin`). Click "OK" to save the changes.
🌐
RDocumentation
rdocumentation.org › packages › installr › versions › 0.23.4 › topics › install.Rtools
install.Rtools function - RDocumentation
install.Rtools(check = TRUE, check_r_update = TRUE, GUI = TRUE, ...) invisible(TRUE/FALSE) - was the installation successful or not. ... checks if there is an R update available (ignores patch versions), if so, asks if user wants to install the R update first.
🌐
R Project
cran.r-project.org › bin › windows › Rtools › rtools44 › rtools.html
Rtools44 for Windows
Rtools44 is also available in base and full toolchain tarballs suitable for users who have their own installation of Msys2. The base toolchain tarball is smaller and includes only what is needed to build R and the recommended packages. All Rtools files are available here. Sources are available for the toochain tarballs and the Rtools44 installer.
🌐
Aaron Chafetz
aaron-chafetz.com › home › manual
Installing R, RStudio, RTools - Aaron Chafetz
August 1, 2023 - The snippets are not limited to just R, but to all of the different languages you can code in within the Rstudio IDE. In the example below, this snippet sets up the formatting of a script for you. To create a new snippet, follow the syntax in the window and click save.
🌐
R-pkgs
r-pkgs.org › setup.html
2 System setup – R Packages (2e)
During the Rtools installation you may see a window asking you to “Select Additional Tasks”. Do not select the box for “Edit the system PATH”. devtools and RStudio should put Rtools on the PATH automatically when it is needed. Do select the box for “Save version information to registry”. It should be selected by default.
🌐
GitHub
github.com › rstudio › rstudio › issues › 3563
RStudio do not find Rtools and offer to install even if already installed · Issue #3563 · rstudio/rstudio
September 30, 2018 - If you get the one on CRAN, it opens a box where you can choose where to install Rtools (by default C:/Rtools) - I do not know why the two installers are different.
Author   rstudio
🌐
Delft Stack
delftstack.com › home › howto › r › install rtools
How to Install rtools in Windows | Delft Stack
March 11, 2025 - Select the version of Rtools that corresponds to your version of R. For example, if you are using R 4.0 or later, download Rtools40. Click on the download link to save the installer to your computer.
🌐
Stack Overflow
stackoverflow.com › questions › 69714671 › how-can-i-setup-my-computer-to-use-rtools-in-rstudio-to-build-packages
r - How can I setup my computer to use RTools in RStudio to build packages - Stack Overflow
I was even able to go through all these steps and it passed, but Files > new project > new directory > new package. Then try to build the template projects results in the endless loop of "Building R Packages requires installation of additional build tools. Do you want to install additional tools now?" ... Added c:\Rtools\mingw_64\bin to my path, no luck.
🌐
Ucdavisdatalab
ucdavisdatalab.github.io › install_guides › r-and-r-tools.html
2 R and R Tools | UC Davis DataLab Install Guides
Over time updates to R and R Studio will necessitate and update. Packages you use may not update with R! If you rely heavily on a package for a project, it is highly recommended you save your current configuration of R and R Studio before updating. If there was a major version change, you will also need to re-install all of your packages.
🌐
Verouden
verouden.net › post › 2022 › 07 › 05 › rtools-installation
Rtools installation on a Windows 10/11 or a WURclient computer | Maikel P.H. Verouden, Ph.D.
July 5, 2022 - The screenshots below are for the installation of Rtools42 and have not been updated, because the procedure for Rtools45 remains the same. Open a File Explorer window (keyboard shortcut: 🪟 + E) and navigate to your downloads folder.
🌐
Posit Community
forum.posit.co › general
Rtools is required to build R packages but is not currently installed - General - Posit Community
February 21, 2021 - Hi how can i evaluate this problem what should i do the error is: WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding: https://cran.rstudio.com/bin/windows/Rtools/ Installing package into ‘C:/Users/Mephi/OneDrive/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified)