Listing R Package Dependencies Without Installing Packages

前端 未结 3 1686
失恋的感觉
失恋的感觉 2020-12-02 23:21

Is there a simple way to get a list of R package dependencies (all recursive dependencies) for a given package, without installing the package and it\'s dependencies? Somet

3条回答
  •  死守一世寂寞
    2020-12-02 23:48

    Another neat and simple solution is the internal function recursivePackageDependencies from the library packrat. However, the package must be installed in some library on your machine. The advantage is that it works with selfmade non-CRAN packages as well. Example:

    packrat:::recursivePackageDependencies("ggplot2",lib.loc = .libPaths()[1])
    

    giving:

     [1] "R6"           "RColorBrewer" "Rcpp"         "colorspace"   "dichromat"    "digest"       "gtable"      
     [8] "labeling"     "lazyeval"     "magrittr"     "munsell"      "plyr"         "reshape2"     "rlang"       
     [15] "scales"       "stringi"      "stringr"      "tibble"       "viridisLite" 
    

提交回复
热议问题