Rtools Is Not Being Detected from Rstudio

RStudio not finding RTools

I have sorted the problem in this way, partly guided by the comments on the question at:

Rtools not being detected by R

Given that devtools::find_rtools() returns TRUE and the check at the end of this webpage using Rcpp (https://thecoatlessprofessor.com/programming/installing-rtools-for-compiled-code-via-rcpp/) works:

Try Sys.which("ls.exe") and Sys.which("gcc.exe"). The former should return a path, but the latter may be empty, which is the problem.

I then found another copy of gcc.exe (in my case it there was one at C:\Rtools\mingw_64\bin, which is a bit maddening) and copied it into C:\Rtools\bin, which is where RStudio seems to want it. That is where ls.exe was found using the Sys.which. That solved the problem for me.

Rtools not being detected by R

Turns out when I installed RTools I left out the R 2.15.x+ toolchain option in the installation, which lead to the gcc never being installed. Hopefully, this post will serve as a diagnostic guide if RStudio fails to register RTools.

Thank you everyone for your help.

Rtools 4.0 not found during package installation

Rtools40 requires that you add its bin directory to your PATH variable. The full instructions are here.

You can update your ~/.Renviron file with any of the following methods:

You can do that manually by opening ~/.Renviron and putting the following in it:

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

You can also use R (Gui or RStudio or Shell) with the following:

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

Both of these methods require a restart of R.

RStudio cannot find Rtools to build package

Turns out I needed to add c:\Rtools\mingw_64\bin; to my PATH as well.



Related Topics



Leave a reply



Submit