As Roland said, Rtools is not a R packages so you must install here: https://cran.r-project.org/bin/windows/Rtools/history.html (according to your R version).
Or you can find out whether your Rtools is already installed or not
Copy# install.packages("pkgbuild")
library(pkgbuild) # load package
find_rtools()
I hope you find the way!
Answer from ainsuotain on Stack Overflowr - Install Rtools and check if I can use it - Stack Overflow
install.packages() tells me that Rtools is not installed, but has_rtools() is able to find Rtools in the default folder
RStudio do not find Rtools and offer to install even if already installed
Rtools is required to build R packages but is not currently installed
Videos
Hi. I updated R recently and everything turned in a mess. Somehow R (nor Rstudio) don't find Rtools but devtools keeps saying that Rtools is in effect installed.
I checked my Path variables several times with no luck. As far as I know, Sys.which("make") points to the correct location but Sys.which("gcc") fails. I tried using the instruction Sys.setevn to point BINPREF properly with no luck too.
Any tips or advice? I run out of ideas checking SE and Rstudio community
Edit: Currently working on a Win 10, with R 4.1.0
Edit 2: already reinstalled Rtools+R with no results. Also Path was updated to point to rtools40/usr/bin as Rtools (windows) help suggest
Edit 3: [SOLVED] Thanks everyone, but none of the solutions works. I decided to use a killer approach (clean installation of windows) and it worked.
There are packages that purport to make it easy to install Rtools, but I avoid these and setup my .Rprofile to point my PATH at the Rtools directory that I install manually.
https://cran.r-project.org/bin/windows/Rtools/
I just ran into this problem no joke 15 minutes ago.
Google “install rtools” and then just start following links. You’ll find an .exe of it. It was a stand-alone install for me.
Sorry I can’t provide a link. I am now on my phone away from my proper computer. Gl hf with the install.
edit: just walked back to my computer. Here is the website that I pulled it from: https://cran.r-project.org/bin/windows/Rtools/
edit 2: Looks like someone sent you the link already but you had problems finding it. Here is the direct for a 64 bit computer: https://cran.r-project.org/bin/windows/Rtools/rtools40v2-x86_64.exe
Here is the direct for a 32-bit computer: https://cran.r-project.org/bin/windows/Rtools/rtools40-i686.exe
Let me start with: this is on my work computer and I work for a place where I am not allowed to download any software myself so I can’t try to update.
I have R version 4.2.1 (2022-06-23 ucrt).
So I was trying to download the tidy verse & ggplot2 and got the following error message:
library(ggplot2) Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘colorspace’ In addition: Warning message: package ‘ggplot2’ was built under R version 4.2.3
——————-.
This led me to try to download colorspace, but that pulled this error:
install.packages('colorspace') 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/twaj/AppData/Local/R/win-library/4.2’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/colorspace_2.1-0.zip'
Content type 'application/zip' length 2628852 bytes (2.5 MB) downloaded 2.5 MB package ‘colorspace’ successfully unpacked and MD5 sums checked The downloaded binary packages are in [the folder].
———————-.
So I tried to download Rtools but i get the same error. I need Rtools to download Rtools.
Any suggestions????