Although I thought I'm close to be professional in Linux but apparently I'm still a beginner. When I login to a server, I need to use the latest version of R (a statistical software). R is installed in 2 places. When I run the following command
which R
I get
/usr/bin/R
and then
R --version
R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-redhat-linux-gnu (64-bit)
apparently it is an old version and I know the last version of R is installed in
/usr/local/bin/R
I know I should change the path. Am I right? and How?
If you put the following in your .bashrc
you will get the newer R
first, because bash will search that directory before the other one.
export PATH=/usr/local/bin:$PATH
Update: Since the OP is apparently using tcsh
, the correct way to set the path is to use setenv
inside ~/.profile
or ~/.tcshrc
.
setenv PATH /usr/local/bin:$PATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With