[R-sig-Debian] A guide to R packages for Ubuntu

Lee Hachadoorian Lee.Hachadoorian+L at gmail.com
Sun Apr 29 19:48:20 CEST 2012


On 04/27/2012 02:11 PM, Michael Rutter wrote:
> As per a request, here is a brief guide to what is available to R 
> users as packages in Ubuntu.
>
> Each release of Ubuntu includes the latest version of R and the 
> recommended packages.  In addition, there are approximately 80 
> additional r-cran packages available in the default repositories.  The 
> limitation to these packages is that they are not updated and reflect 
> the current version of the program or package when that version of 
> Ubuntu was released.
>
> If you want to have current versions of R and the recommended 
> packages, there are two repositories to choose from:
>
> CRAN: http://cran.r-project.org/bin/linux/ubuntu/
> Launchpad PPA: https://launchpad.net/~marutter/+archive/rrutter
>
> Both sites have the same packages (the PPA packages are mirrored on 
> CRAN), but there may be a reason to use one over the other.
>
> CRAN Advantages:
> - A local mirror may be faster in terms of internet speed.
> - Older versions of the packages are available, so if an update to R 
> or a core package breaks your code, you can reinstall an older version 
> via synaptic or apt.
>
> PPA Advantages:
> - Quickest way to get the updates (only by about 24 hours however)
> - Easy to install (sudo add-apt-repository ppa:marutter/rrutter)
>
> If you have been using CRAN, then there is no reason to change to the 
> PPA, as the same packages is provided at both locations.  I will 
> continue to maintain both sites, so no need to worry about one or the 
> other going away.
>
> If you want additional packages (over 1,100), you can check out my 
> cran2deb4ubuntu PPA:
>
> https://launchpad.net/~marutter/+archive/c2d4u
>
> In theory, this PPA has all the packages listed in the CRAN Task Views 
> and any dependencies.  In practice, is has about 98% of them, as some 
> packages have issues.  These packages can be installed via synaptic or 
> apt (sudo apt-get install r-cran-ggplot2, for example).  The main 
> advantage of this approach is that tricky Ubuntu package requirements 
> will automatically be installed when installing the package.  They 
> will also be automatically updated during normal Ubuntu updates, which 
> is another advantage.  These packages are NOT installed when a 
> install.packages("foo") command is used from within R.
>
> One of my plans this summer/sabbatical is create documentation for the 
> cran2deb4ubuntu project and give more information about what is and 
> what is not available.
>
> If you have any further questions, please let me know.
> Michael
>
Michael,

Thanks so much for this information. I have a question about 
cran2deb4ubuntu PPA. Currently I use a CRAN repository, then 
install.packages() within R for whatever isn't available in the 
repository. If I want to use cran2deb4ubuntu, does it completely replace 
the CRAN repository? Or do I use both and let the package manager 
determine where to retrieve a package from?

Also, since I have many packages installed within R, do you know what 
the effect would be of adding the PPA? Would installed packages get 
updated, or would I have to uninstall in R and reinstall via PPA?

Thanks again for your work on this.

--Lee

-- 
Lee Hachadoorian
PhD, Earth&  Environmental Sciences (Geography)
Research Associate, CUNY Center for Urban Research
http://freecity.commons.gc.cuny.edu



More information about the R-SIG-Debian mailing list