Skip to content
Prev 29453 / 63424 Next

Windows: adding R/bin folder to the PATH variable

On Fri, Jul 18, 2008 at 4:18 AM, Prof Brian Ripley
<ripley at stats.ox.ac.uk> wrote:
There are two other problems, as well:

- you might want to use two different versions of R on the same
computer

- the directory that normally resides at c:\rtools\bin contains a find
command which conflicts with the Windows find command so if
you keep rtools\bin in your path it can cause other Windows scripts
to fail.

At any rate, note that batchfiles at

http://batchfiles.googlecode.com

has Rcmd.bat, R.bat, Rgui.bat, etc. that you just place anywhere in your
path and they will automatically find R and rtools from the registry and
MiKTeX via a heuristic and then launch the corresponding R .exe .
Just place one of them or all of them anywhere in your path in which case
no path changes are required to run R or to build R packages at all.

They also have the advantage that if you use them you can be sure that the
temporary PATH that they set up and remove on the fly gets set properly which
is an advantage since, based on messages on r-help or r-devel, wrong setting of
PATH is a frequent problem.