How to install the latest version of R and Rstudio in Ubuntu

First install R

sudo apt-key adv --keyserver --recv-keys E084DAB9

sudo add-apt-repository ppa:marutter/rdev

sudo apt-get update && sudo apt-get upgrade

sudo apt-get install r-base r-base-dev

Then R Studio

Go to Download Page and copy the address of the version required (usually the 64b)

And finally install RStudio

sudo dpkg -i *.deb
sudo dpkg -i *.deb