I recently updated R from 3.6.1 to 4.0.2. Along with that, I updated to the latest version of rtools (rtools40). I also followed instructions to add rtools40 to the PATH here.
However, after restarting R, Sys.which("make")
gives "C:\\Rtools\\bin\\make.exe"
, an older version of Rtools. But C:/Rtools/bin
is not in my PATH.
Without deleting the old rtools, how can I tell R to use rtools40?
Edit: It turns out that the old Rtools was on the system PATH (but not on the user PATH). Removing the old Rtools/ from system PATH fixed the issue.
Posting my comment as an answer, so that others may more easily find the solution:
When updating from Rtools to Rtools40, make sure that the old Rtools is removed from the system and user PATH
. In order to check which version you have in your path, you can use Sys.which("make")
like you suggested in your question.
It is also possible to check by running Sys.getenv("PATH")
.