There are two components to get RStudio to work
First, get R from PPA
You can get R from the repositories, but it likely won't be the latest version. I use Michael Rutter's PPA. The following commands will get the latest version of R installed:
sudo add-apt-repository ppa:marutter/rrutter
sudo apt-get update
sudo apt-get install r-base r-base-dev
Second, install RStudio
Unfortunately, the makers of RStudio do not make their software available via a PPA or in the Ubuntu repository. You have to install it from the
deb file which is available on their website.
- Go to https://www.rstudio.com/products/rstudio/#Desktop
- Click on DOWNLOAD RSTUDIO DESKTOP button.
- Look for "RStudio Desktop Open Source License" and click the
DOWNLOAD button below it.
- Look under the "Installer for supported platform" and find that
says: "RStudio x.y.zzz - Ubuntu 12.04+/Debian 8+ (64-bit)", assuming
you are using 64 bit Ubuntu and click on it. This will download the
`deb' file. Wait for the download to complete.
- Open the file browser and double click on the Deb file to open it in
the Software Center.
- Install using software center.
If you run into libgstreamer dependency issues see Install the lastest version of RStudio
You are right, the
deb file will not update itself and revisiting the RStudio every now and then to see there are updates is tedious. Inside RStudio Menu > Help > Check for Updates eases the pain somewhat. If you click on this RStudio will check for updates of itself and give you the option to close RStudio and download the new
deb file. This will close RStudio and open your default web browser and take you to the RStudio download page in step 3 above.
You can get RStudio to automatically check for updates in Menu > Tools > Global Options...> General Tab> Automatically notify me of updates to RStudio check box.
As you use R, you will need to install other R packages. Sometimes these are available in the repositories. Say the r package you want it
foo then the package in the repositories is called
sudo apt-get r-cran-foo
will get the job done. This is the best option as it will keep
foo updated. However, this does not always work.
If this does not work you will want to install and/or update R packages from inside RStudio. If you do this, you will find that RStudio would put the new files (including updates) inside in your home directory
One way to solve this problem and let RStudio install additional packages in its proper place is to add yourself to the group
staff by using the following command in the Ubuntu terminal:
sudo adduser <user> staff
<user> with your username.
After this, you will get the option of installing or updating packages
/usr/local/lib/R/ or in
/home/<user>/R/. Then you will be able to choose the former as the default install location.
Hope this helps