0

In CRAN, each package has Package Depends, Imports and LinkingTo http://cran.r-project.org/web/packages/Rcpp/index.html. Is there a build-in function or a function from an R package that can return the same information? Thanks.

user1424739
  • 11,937
  • 17
  • 63
  • 152
  • 1
    Are you looking for something that queries CRAN to get this information, or something that gets the information about a currently-installed package? – David Robinson Jul 06 '15 at 19:15
  • Bioconductor's [pkgDepTools](http://bioconductor.org/packages/1.9/bioc/vignettes/pkgDepTools/inst/doc/pkgDepTools.pdf) might be of use. – hrbrmstr Jul 06 '15 at 19:44

2 Answers2

2

Sure. Both available.packages() and installed.packages() have it:

R> AP <- available.packages()
R> dim(AP)
[1] 6793   17
R> AP[1:5, c("Depends", "Imports", "LinkingTo")]                                                                                                                                                                                          
            Depends                                               Imports          LinkingTo                                                                                                                                              
A3          "R (>= 2.15.0), xtable, pbapply"                      NA               NA                                                                                                                                                     
abbyyR      "R (>= 3.2.0)"                                        "httr, XML"      NA                                                                                                                                                     
abc         "R (>= 2.10), abc.data, nnet, quantreg, MASS, locfit" NA               NA                                                                                                                                                     
ABCanalysis "R (>= 2.10)"                                         "Hmisc, plotrix" NA                                                                                                                                                     
abc.data    "R (>= 2.10)"                                         NA               NA                                                                                                                                                     
R> 
Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
1

The package DESCRIPTION file has this info. The function in the utils package packageDescription will parse and read this. See ?packageDescription

Nick Kennedy
  • 12,510
  • 2
  • 30
  • 52