This version of Ubuntu installs an Older version of R (2.x), thus making the installation of ggplot2 infeasible. Because ggplot2 requires >3.x version of R.
To upgrade the installed R to a higher version do, the following:
To upgrade the installed R to a higher version do, the following:
sudo gedit /etc/apt/sources.list
This will open up yoursources.list
file ingedit
, where you can add the following line.deb http://cran.cnr.berkeley.edu/bin/linux/ubuntu/ version/
Replaceversion/
with whatever version of Ubuntu you are using (eg,precise/
,oneric/
, and so on). If you're getting a "Malformed line error", check to see if you have a space between/ubuntu/
andversion/
.- Fetch the secure APT key with
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
- Feed it to apt-key with
gpg -a --export E084DAB9 | sudo apt-key add -
- Update your sources and upgrade your installation with
sudo apt-get update && sudo apt-get upgrade
.
This will install a higher version of R. So you can go inside R and perform a install.packages("ggplot2").
Hope it helps someone.
No comments:
Post a Comment