Hi,
I am unable to install packages in RStudio,
I also downloaded RTools but the installation instructions on CRAN aren't very clear.
Instructions below, not sure how to create the files and where to place them:
(RTools: Toolchains for building R and R packages from source on Windows)
Putting Rtools on the PATH
After installation is complete, you need to perform one more step to be able to compile R packages: you need to put the location of the Rtools make utilities ( bash
, make
, etc) on the PATH
. The easiest way to do so is create a text file .Renviron
in your Documents folder which contains the following line:
PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"
You can do this with a text editor, or you can even do it from R like so:
writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")
Now restart R, and verify that make
can be found, which should show the path to your Rtools installation.
Sys.which("make")
## "C:\\rtools40\\usr\\bin\\make.exe"
If this works, you can try to install an R package from source:
install.packages("jsonlite", type = "source")
If this succeeds, you’re good to go! See the links below to learn more about rtools40 and the Windows build infrastructure.