I recently installed R 4.0.0. Along with it, I also installed Rtools40. The CRAN website said I also need to specify path for Rtools make file in the .Renviron file. But when I created the .Renviron file, I cannot use stats package. If .Renviron file exists, it gives error that some shared dll file is missing. And if I delete the .Renviron file, this error goes away, but I cannot compile packages using Rtools40. How can I configure this .Renviron file so that I can also use both - Rtools40 and stats package? My Rtools make file is in C:/(MyUserName)/Rtools40/usr/bin folder. This same folder also contains the bash file, which came with Rtools40.
-
Dies this help: https://community.rstudio.com/t/problems-with-r-4-0-0/62958/7?u=yarnabrina – yarnabrina Apr 26 '20 at 10:54
-
@yarnabrina I found that (thanks). In the Environmental Variables window, "variable value" is set to "C:\rtools40\usr\bin". I don't know what "variable name" needs to be? Is it "RTOOLS40"? – Eric Krantz Jul 27 '20 at 16:19
-
1@EricKrantz you don't need to add a new environment variable. There's already a variable for PATH at user level. If you select that, you should get a box with a list of paths. Append the path to rtools to that list. That should be enough. – yarnabrina Jul 28 '20 at 03:22
2 Answers
writeLines('PATH="${PATH};${RTOOLS40_HOME}\\usr\\bin"', con = "~/.Renviron")
I had the same problem. I was following the Rtools40 download instructions, and instead of adding Rtools to the beginning of the path, adding it to the end fixed it.

- 21
- 2
I have been always using a folder "C:\s" to deploy the always changing versions of R related software friends. I recently installed Rtools40 to "C:\s\rtools40" and linking it with my R-4.0-1 was straightforward to me. I just went to "C:\s\R-4.0.1\etc\x64", edited the "Makeconf" file using WordPad, and replaced the line
RTOOLS40_HOME ?= c:/rtools40
With
RTOOLS40_HOME ?= c:/s/rtools40
Then I did the same for "C:\s\R-4.0.1\etc\x32". After these, I installed a package using RStudio (running install.packages("jsonlite", type = "source") in the R-4.0.1 console), and no warning related to Rtools was displayed in the console. I hope this works well in your machine.

- 62
- 2