Installing Rtools in different location other than root of C:

Is there a way to Install Rtools, as it gives you the option to install it in a different location other than the root of C: so that Rstudio will recognize it is installed? When i install in the Program Files directory, for example, if i open up a c++ workspace in Rstudio, it still triggers an install for an older version, 3.5, of Rtools as if i hadn't even installed version 4.0

1 Like

Yes, that is possible. I installed Rtools40 in a subfolder of a folder on another drive containing various tools.
However the Windows path must be (temporarily) adapted for that:

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}"

This information can be found on the CRAN website : see Software | R Binaries | Windows | Rtools

If you want to be able to use the tools also outside of R, then change the path permanently!

1 Like

would the PATH in the brackets be the location of the rtools folder?

PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"

I think this means the following.
During the install the environment variable ${RTOOLS40_HOME} was set to the location of the tools.
${PATH} is the list with folders in the system path.
The statement PATH="${RTOOLS40_HOME}\usr\bin;${PATH}" adds the location of the tools to this list.

So nothing else to do then inserting this statement in .Renviron .

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.