The (aggregated) history of every CRAN package ever

Mark Padgham, rOpenSci

ropensci.org
mark@ropensci.org

The (aggregated) history of every CRAN package ever

Mark Padgham, rOpenSci

pkgstats

docs.ropensci.org/pkgstats
Search "ropensci pkgstats"

Extract summary statistics of R package structure and functionality. Not all statistics of course, but a good go at balancing insightful statistics while ensuring computational feasibility.

What

statistics

?

What

statistics

?


  • > 90 statistics
  • DESCRIPTION statistics
    • Authors, contributors
    • URL(s)
    • Dependencies
  • Languages, files and lines-of-code
  • "Objects" (or "functions" in R)
  • Relations between objects
    • Including across all languages (R → C; js → C++)
  • External calls to all R functions

What

am I going to talk

about

?

  1. CRAN submissions
  2. Package metadata
  3. Package structure
  4. Documentation
  5. Functions
  6. Dependencies
  7. Stability

Cran submissions

Annual

submissions

annual submissions

New / total

submissions

annual submissions

No significant change

Package MetaData

Authors & Contributors

annual submissions

Why are there
two lines?

How to define CRAN in any one year?

  • Snapshot at end of year
    • Includes packages from prior years
  • Average of all uploads in that year

Authors & Contributors

Authors and contributors

Packages with

URLs

Packages with URLs

Top 10

URLs

Top 10 URLs

Top 10

Translations

Top 10 URLs

Package Structure

Numbers of

Files

Numbers of files

Numbers of

Functions

Numbers of files

Numbers of

Functions

per File

Numbers of files

Numbers of

Lines of Code

Numbers of files

Lines of Code

per

Function

Numbers of files

Documentation

Numbers of

Files

Numbers of files

Numbers of

Vignettes

Numbers of files

Function & parameter documentation

Numbers of files

Package functions

Function

Call

s

Numbers of files

Function

Call

Networks


With time:

  • Function call networks become denser
  • And constently more centralised

>With package maturity:

  • Function call networks become far denser
  • Enormously more centralised (>5×)
  • And contain more discrete clusters

Package Dependencies and Network Structure

CRAN

package

dependencies

pkg dependencies
snapshots
uploads

CRAN

network

metrics

pkg dependencies

stability

Coupling in

stability

I = ne na + ne

n = N umbers of function calls not packages

Coupling in

stability

  • More stable:
    • Packages used by others
    • Packages don't use others
  • Less stable:
    • Packages not used by others
    • Packages only use others

Coupling in

stability

Coupling instability

Imports by other packages

Package imports

Summary

Summary

Getting Better:

  • Numbers of authors & contributors
  • Use of URLs (code hosting)
  • Numbers of test files
  • Numbers of functions
  • Numbers of vignettes
  • Centrality of function networks

Summary

Neutral:

Improvement through package maturity only

  • Ratio of new/total submissions to CRAN
  • Size of packages
  • Function & parameter documentation
  • Integration of function networks
  • Proportion of non-imported packages (~60%)
  • Average centrality of whole CRAN network
  • Coupling stability & use by other packages

Summary

Getting Worse:

  • Translations
  • Use of base R functions in favour of contributed
  • Numbers of data files

Conclusion: Update intervals

Update intervals

pkgstats