I am having trouble with rtools
. Sys.which("make")
yields an empty vector (working from R Studio
)
Sys.which("make")
“”
This is my R Version
R.Version()$version.string
[1] “R version 4.1.3 (2022-03-10)”
Apparently, this is an issue with my PATH
.
Sys.getenv("PATH")
C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:Users…Miniconda3;C:Users…Miniconda3Librarymingw-w64bin;C:Users…Miniconda3Libraryusrbin;C:Users…Miniconda3Librarybin;C:Users…Miniconda3Scripts;C:Users…AppDataLocalProgramsPythonPython39Scripts;C:Users…AppDataLocalProgramsPythonPython39;C:Users…AppDataLocalMicrosoftWindowsApps;C:Users…AppDataLocalProgramsMicrosoft VS Codebin”
I have tried to set the PATH
to rtools
the following.
I have created a ~/.Renviron
file
PATH="${RTOOLS40_HOME}usrbin;${PATH}"
I also have tried this one
file.edit(file.path("~", ".Rprofile"))
Sys.setenv(PATH = paste("C:/Rtools/bin", Sys.getenv("PATH"), sep=";"))
However, still no luck.
How do I set the path to rtools
?
0
This is how I solved it:
- 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:rtools40usrbin
. I edited the environment Variable accordingly. Here is an instruction how to edit the environment variables on windows.
- I also added this to the
.Renviron
file:
PATH="${RTOOLS40_HOME}usrbin;${PATH}"
The .Renviron
file should be created/located accordingly to this location
Sys.getenv("HOME")
I had a similar problem. My workaround: Upon checking Sys.getenv("PATH")
I found that I had a different verison of rtools (42 instead of 43 as listed there). I uninstalled the wrong version and downloaded rtools43. Now it works.