The evolution of the dependencies of CRAN packages

Clement Lee

useR! 2021 conference

Managing package dependencies

logo

Introduction to crandep

logo
Number of packages Number of types function object returned
\(1\) any get_dep() data frame
all all get_dep_all_packages() data frame
all \(1\) (or more) get_graph_all_packages() igraph object

All types, all CRAN packages

logo
##    from             to    type reverse
## 2 aaSEA             DT imports   FALSE
## 3 aaSEA      networkD3 imports   FALSE
## 4 aaSEA          shiny imports   FALSE
## 5 aaSEA shinydashboard imports   FALSE
## 6 aaSEA       magrittr imports   FALSE
## 7 aaSEA       Bios2cor imports   FALSE
##         from         to     type reverse
## 411665 Zelig  stargazer enhances    TRUE
## 411666 Zelig     texreg enhances    TRUE
## 411697   zoo      chron enhances    TRUE
## 411698   zoo  lubridate enhances    TRUE
## 411699   zoo RcisTarget enhances    TRUE
## 411700   zoo        tis enhances    TRUE
logo
##          type reverse     n
## 1     depends   FALSE 11392
## 2     depends    TRUE  9900
## 3    enhances   FALSE   513
## 4    enhances    TRUE   533
## 5     imports   FALSE 72582
## 6     imports    TRUE 66248
## 7  linking to   FALSE  4319
## 8  linking to    TRUE  4647
## 9    suggests   FALSE 45738
## 10   suggests    TRUE 50728
## [1] 16708
## [1] 266600

Growth of dependencies

Network of dependencies

logo
(g0 <- get_graph_all_packages(type = "depends"))
## IGRAPH 625b0ca DN-- 4940 8281 -- 
## + attr: name (v/c)
## + edges from 625b0ca (vertex names):
##  [1] A3         ->xtable     A3         ->pbapply    abc        ->abc.data  
##  [4] abc        ->nnet       abc        ->quantreg   abc        ->MASS      
##  [7] abc        ->locfit     abcdeFBA   ->Rglpk      abcdeFBA   ->rgl       
## [10] abcdeFBA   ->corrplot   abcdeFBA   ->lattice    ABCp2      ->MASS      
## [13] abctools   ->abc        abctools   ->abind      abctools   ->plyr      
## [16] abctools   ->Hmisc      abd        ->nlme       abd        ->lattice   
## [19] abd        ->mosaic     abn        ->nnet       abn        ->lme4      
## [22] abodOutlier->cluster    Ac3net     ->data.table acc        ->mhsmm     
## + ... omitted several edges
igraph::is.dag(g0) # whether it is a directed acyclic graph
## [1] TRUE

visNetwork plot

logo

Degree distribution - power law?

logo

Future work

logo