Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check whether R is already installed in Ubuntu? [closed]

Tags:

r

ubuntu

I am newbie to R and I think I previously installed R but not sure.

Is there any way to know whether R is installed in your system?

like image 682
WitVault Avatar asked Sep 19 '14 18:09

WitVault


People also ask

How do you check if I have R on Linux?

Type R --version at the linux command line. Note: it has to be capital R.

Where does R install Ubuntu?

Maintenance of R Packages The other r-cran-* packages shipped with Ubuntu are installed into the directory /usr/lib/R/site-library.

Where does R get installed Linux?

Some systems are set up to have /usr/bin (the standard place for a system installation) ahead of /usr/local/bin (the default place for installation of R) in their default path, and some do not have /usr/local/bin on the default path.


1 Answers

On ubuntu I would typically use the which command to check for existance of a program. which is a Unix command used to identify the location of executables. If the R executable is somewhere in the PATH then it should return its location:

john@ubuntu:~$ which R
/usr/bin/R

Alternatively you can use the type command:

john@ubuntu:~$ type R
R is /usr/bin/R

type is a Unix command that describes how its arguments would be interpreted if used as command names.

failing R being on the PATH you could resort to locate which would be faster then find however it will most likely give you a large number of returns for R so some filtering would be required:

john@ubuntu:~$ locate -b R | fgrep -w R/bin
/usr/lib/R/bin/R
/usr/lib/R/bin/REMOVE
/usr/lib/R/bin/Rcmd
/usr/lib/R/bin/Rd2pdf
/usr/lib/R/bin/Rdconv
/usr/lib/R/bin/Rdiff
/usr/lib/R/bin/Rprof
/usr/lib/R/bin/Rscript
/usr/lib/R/bin/exec/R
like image 183
jdharrison Avatar answered Oct 02 '22 04:10

jdharrison