Installing R on Ubuntu 12.04
I install R using the instructions at cran.r-project.org (direct link to instructions). At the website, click ‘Download R for Linux’ then ‘ubuntu’ to get the most up-to-date instructions. Following these instructions, my process was as follows:
Add the repository, using the CRAN server of your choice (I use UCLA here) and the appropriate Ubuntu version (I use precise for Ubuntu 12.04):
sudo add-apt-repository "deb http://cran.stat.ucla.edu/bin/linux/ubuntu precise/"
For security, get the key and add it to your keyring (NOTE: the CRAN website says that some people are having issues with this step — if the commands here do not work for you, check there for latest information):
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 gpg -a --export E084DAB9 | sudo apt-key add -
Next, update and install (the documentation says you might want to install r-base-dev as well, but I found this package is already included using the commands below):
sudo apt-get update sudo apt-get install r-base
To install package not in the base set, use the following commands
Now, inside R, install package packagename with
install.packages('packagename', dep = TRUE)
Note — the quotes around the packagename ARE needed.
Again, start R with sudo:
Now, inside R, update packages with
update.packages(ask = FALSE)
- Download the debian package from http://www.rstudio.org
- I downloaded RStudio 0.97.237 – Debian 6+/Ubuntu 10.04+ (64-bit) — this is actually a file: rstudio-0.97.237-amd64.deb
- If all dependencies are installed (output will complain if not), install rstudio-0.97.237-amd64.deb file using
sudo dpkg -i rstudio-0.97.237-amd64.deb
I got a complaint about libjpeg62 and installed is using:
sudo apt-get install libjpeg62
followed by the installation of the deb file, as shown above.