Which R am I using?

There are two sets of instructions - one for a temporary change of path and one for a permanent change. You are advised to do the temporary change to make sure R is doing what you want, then make the change permanent.

1. Check which shell you are using

Before either testing this version or using the new version permanently you need to know which shell you are using. The command

echo $SHELL

should produce one of /bin/bash/bin/(t)csh/bin/ksh .

Make sure you then follow the instructions that are for your particular shell - the change won't work otherwise.

2.  Changing your path temporarily

These changes to your path will only last while your session is active. When you log out the changes will disappear. If you are using /bin/bash use the command

export PATH=/usr/local/bin:$PATH

If you are using /bin/(t)csh set

path=(/usr/local/bin $path)

If you are using /bin/ksh

 PATH=/usr/local/bin:$PATH

Then type in

 which R

which should show

 /usr/local/bin/R


3. Changing your path permanently

The following instructions assume that you have a standard .profile file: this is found in your home directory. Mail ithelp@stats.ox.ac.uk if you want to see a copy of the standard .profile file.

To change your path permanently edit your .profile file (carefully) and add a line

 PATH=/usr/local/bin:$PATH

before the comment line

 # PAGER:

This is the command which you use to show output a screen at a time, if there is no PATH variable defined.

If there is already a PATH variable add /usr/local/bin to the beginning of the list of directories. For example, if
you have

 PATH=${HOME}/bin:${PATH}:/opt/sbin:/data/`hostname`

edit this to

 PATH=/usr/local/bin:${HOME}/bin:${PATH}:/opt/sbin:/data/`hostname`

You will need to log out and log back in again for this change to come into effect.

Again, check that you are running the correct version with

 which R