Skip to Content

The top 10 critical packages on CRAN

David Smith's picture

While most R packages on CRAN are designed to be used by an R user directly, a few packages are designed to be used by other package developers. (And some packages are so useful that they're regularly used by both camps.) When a package author publishes a package to CRAN, she must list those packages that provide functions her package uses (this is the Depends: field in the DESCRIPTION file). The number of times a package is listed as a dependency is a measure of how often it's relied upon by package authors.

Dirk Eddelbuettel recently analyzed the packages on CRAN according to the number of times they were listed as a dependency by other packages, and the top 10 packages were:

  1. mvtnorm: Multivariate Normal and t Distributions 
  2. coda: Output analysis and diagnostics for MCMC
  3. Rcpp: Seamless R and C++ Integration
  4. sp: Classes and methods for spatial data
  5. rgl: 3D visualization device system (OpenGL)
  6. ggplot2: An implementation of the Grammar of Graphics
  7. XML: Tools for parsing and generating XML within R and S-Plus
  8. rJava: Low-level R to Java interface
  9. Hmisc: Harrell Miscellaneous
  10. zoo: S3 Infrastructure for Regular and Irregular Time Series (Z's ordered observations)

These are the top 10 "critical packages" on CRAN, in the sense that if they disappeared from CRAN or stopped working, they'd make many other packages that depend on them break as well. I didn't include in this list any of the "recommended" R packages, because they're included in R's standard distribution and generally considered to be "part of R. Nonetheless, the packages MASS, lattice, survival, Matrix, nlme and boot all appear in the top 10 of the most frequently-cited package dependencies in Dirk's chart below, so it makes sense that they're made available to all R users.

(Update Aug 17: Dirk has updated his analysis, and also now provides code to reproduce it.)

Thinking outside the box: Counting CRAN Package Depends, Imports and LinkingTo