user1424739
user1424739

Reputation: 13655

Is there a function in R that return Package Depends, Imports and LinkingTo?

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.

Upvotes: 0

Views: 89

Answers (2)

Dirk is no longer here
Dirk is no longer here

Reputation: 368181

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> 

Upvotes: 2

Nick Kennedy
Nick Kennedy

Reputation: 12640

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

Upvotes: 1

Related Questions