GNU R‎ > ‎

Install R

Install and update R software on Linux

To get the most recent version of R, add the a CRAN repository to the list of APT sources.

a) Ubuntu
sudo add-apt-repository "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/"
sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys E084DAB9
https://cran.rstudio.com/bin/linux/ubuntu/

b) Debian
sudo add-apt-repository "deb http://cran.rstudio.com/bin/linux/debian jessie-cran3/"
gpg --keyserver pgp.mit.edu --recv-key 381BA480
gpg -a --export 381BA480 | apt-key add -


Install R

sudo apt-get update
sudo apt-get install r-base

Upgrade R to a newer R version
sudo apt-get upgrade r-base


Start R by tying "R"    Exit R by typing "q()"
$ R
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
>
> 3*4 # simple calculation
[1] 12
>
>
q()   # exit (quit) R
Save workspace image? [y/n/c]: n


See also
 sessionInfo()    to get current R version

Install RStudio

comfortable R editor and programming tool

# Download and install RStudio on Ubuntu Linux
wget https://download1.rstudio.org/rstudio-0.99.903-amd64.deb
sudo dpkg -i rstudio-0.99.903-amd64.deb
https://www.rstudio.com/
Error: Package libjpeg62 is not installed ?

Start RSudio by typing "rstudio" in the command line.


Windows

download "base" version
http://mirrors.ebi.ac.uk/CRAN/
# for updating an older R version, uninstall the old version first before installing the latest version