by Joseph Rickert
For a knitty gritty look at what’s new with R there is no better place to start than Dirk Eddelbuettel’s CRANberries site. Since 2007, the site has been reliably providing near real-time status on CRAN packages. Now, every two hours, CRANberries displays updated information on new R packages, updated R packages and R packages that have been removed. The following is a partial view of today’s CRAN: New page.
Referring to his site in the About page Dirk states: “There is not much to it, R already gives us a function available.packages().The part about there not being much to it is clearly an understatement: Dirk has harnessed a good bit of technology and a significant amount of know how to make things work smoothly. However, it is the case that available.packages() is a pretty amazing function. available.packages() links to CRAN and returns a boatload of information about the packages there including name, version, Depends, Imports, Suggests and much more.
As first exercise, I thought it would be interesting to look just at the Depends field, which as the Writing R Extensions Manual explains, gives a comma-separated list of package names which a given package depends on, and can also specify a dependence on a certain version of R. The following histogram shows a single snapshot of the distribution of the number of dependencies in CRAN packages.
(Download Depends to get the code for the histogram.)
Most packages have fewer than 3 dependencies (median = 2), but there are 33 packages that have 10 or more. The winner is the sisus package for “source partitioning using stable isotopes” with 19 dependencies.
The help file for the function indicates that it is possible to get even more package information than is included in the default settings. available.packages() provides a window into CRAN and R that with a little work could provide some real insight into the structure of R packages.