How to point R to the rtools installation?

I need to install an r package from source as the machine is not connected to web.
Hence, i need to install from source. I got the .tar.gz files for the required packages.

when i run. install.packages(“path“, repos=NULL, type="source") i get told Rtools is required.

Rtools is installed at D:\Program Files\R\rtools42 (R is installed nearby at D:\Program Files\R\R-4.1.3)

i set up the system wide variable RTOOLS42_HOME to D:\Program Files\R\rtools42\usr\bin
(because i cannot get the .Renviron to be found) (placed it at D:Program Files\R.Renviron with the system variable R_ENVIRON_USER at D:\Program Files\R - another issue for another time)

yet despite the system variable the r session (in rstudio) does not find that and says, there is no installation:
“WARNING: Rtools is required to build R packages but is not currently installed.“.

What can I do to point R towards the r installation?

RTools42 is to be used with R >= 4.2.0, for your R version you should be using RTools40

1 Like