There are lots of directives on the web how to upgrade R version or installing the latest version of R. Here I am going to tell the clearest and success way that I have done.
Open your terminal (Ctrl+Alt+T)
1. Uninstall current R version on your system
sudo apt-get remove r-base-core
2. Add cran.rstudio deb to sources.list
sudo nano /etc/apt/sources.list
Paste the below code in to your sources.list
deb http://cran.rstudio.com/bin/linux/ubuntu precise/
My version is “precise”. That’s why the line ends with “precise”. You can learn your Ubuntu version:
Codename is your version….
3. Add key to sign CRAN packages
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
4. Add PPA (for CRAN) to your system
sudo add-apt-repository ppa:marutter/rdev sudo apt-get update sudo apt-get upgrade
sudo apt-get install r-base