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
Why Would R Use the "L" Suffix to Denote an Integer
Missing Legend with Ggplot2 and Geom_Line
"Correct" Way to Specifiy Optional Arguments in R Functions
Building R Package and Error "Ld: Cannot Find -Lgfortran"
How to Use R with Google Colaboratory
Check for Installed Packages Before Running Install.Packages()
How to Use Objects from Global Environment in Rstudio Markdown
Remove Multiple Objects with Rm()
Creating a Prompt/Answer System to Input Data into R
Rstudio Rmarkdown: Both Portrait and Landscape Layout in a Single PDF
Add Multiple Columns to R Data.Table in One Function Call
Fast Pairwise Simple Linear Regression Between Variables in a Data Frame
Convert Data.Frame Column to a Vector
Function to Calculate Geospatial Distance Between Two Points (Lat,Long) Using R