On 22.08.2011 18:43, Rainer M Krug wrote:
Hi

I want to create a dependence diagram of a subset of the packages on CRAN
and would therefore like to read the DEACRIPTION files into a list. The list
should be as follow for each package:

- package name: list
   - Package: character
   - Version: character
   - Date: character
   - ...
   - Depends: character vector
   - Suggests: character vector
   - ...

Some of these informations are collected in the CRAN repository's PACKAGES file. If those are not sufficient, you can also read separate DESCRIPTIONS files, of course.

There is packageDescription() in utils for accessing installed packages' DESCRIPTION information or just use read.dcf() to read the DESCRIPTION files directly.

Example:
as.list(read.dcf(system.file("DESCRIPTION", package="tools"))[1,])


For the dependency diagram, see
dependsOnPkgs() and .package_dependencies() (the latter internal) in package tools, as well as what these guys wrote: Theußl, S., Ligges, U. and Hornik, K. (2011): Prospects and Challenges in R Package Development. Computational Statistics 26 (3), 395-404.

Uwe Ligges







I downloaded all packages and extracted all DESCRIPTION, but I am struggling
with the creation of the list (I tried using scan(what=list(),
multi.line=TRUE) with different things in list()). Before I spend to much
time on it, is there a function which could help me or has somebody done
something similar (I assume the DESCRIPTION file ust be somewhere be read
dueing install.packages()?

Cheers,

Rainer



______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to