[R] R package dependencies

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Jan 14 15:05:32 CET 2010


For the original question:

 >   what are a packages dependencies

tools:::package.dependencies(available.packages())


 >   what are a packages reverse dependencies

tools:::dependsOnPkgs(available.packages()[,1])


 >   does a package contain a dll

If the package has been installed already and you want to get the number 
of dlls in libs:

   length(grep("\\.dll$", dir(system.file(package="foo", "libs"))))

or if not installed, you can get an idea by looking at the check logs on 
CRAN. If they contain a line
  * checking line endings in C/C++/Fortran sources/headers ... OK
they also contain compiled code. This is not a save test, though.

Uwe Ligges







On 14.01.2010 12:27, Colin Millar wrote:
> Thanks Gabor,
>
> Are you or anyone aware if there is a text list of of package contents?  The only way i have managed to get information like the number of dlls per package is by downloading the zip file to a tempporary file and listing its contents via unzip(..., list  = TRUE).  However, downloading every package on CRAN is a time consuming so if there was a more efficient way of finding the contents of each it would be useful to know.
>
> The code i am using on R2.10.1 on windows 7
>
> contriburl<- "http://cran.uk.r-project.org/bin/windows/contrib/2.10<http://cran.uk.r-project.org/bin/windows/contrib/2.10>  "
> destdir<- "C:/colin/SCOTS-user-group/pkgs"
> lab.pkgs<- c("gamair","mgcv","survival","lme4","nlme","lattice","MASS","nnet","splines","stats4", "stats", "methods")
>
> available<- available.packages(contriburl = contriburl)
> fnames<- paste(available[,"Repository"], available[,"File"], sep = "/")
> tmpf<- paste(tempfile(), ".zip", sep = "")
>
> pkg.contents<- lapply(fnames, function(x) {download.file(x, tmpf); unzip(tmpf, list = TRUE)})
> ndlls<- sapply(pkg.contents, function(x) sum( grepl( ".dll", x $ Name )))
> pkg.summ<- data.frame(pkg = rownames(available), dll = ndlls)
>
>
> Thanks again,
> Colin.
>
> ________________________________
>
> From: Gabor Grothendieck [mailto:ggrothendieck at gmail.com]
> Sent: Wed 13/01/2010 22:09
> To: Colin Millar
> Cc: r-help at r-project.org
> Subject: Re: [R] R package dependencies
>
>
>
> See the dep function defined here:
> http://tolstoy.newcastle.edu.au/R/e6/help/09/03/7159.html
>
> On Wed, Jan 13, 2010 at 11:39 AM, Colin Millar<C.Millar at marlab.ac.uk>  wrote:
>> Hi there,
>>
>> My question relates to getting information about R packages.  In particular i would like to be able to find from within R:
>>   what are a packages dependencies
>>   what are a packages reverse dependencies
>>   does a package contain a dll
>>
>> The reason i ask is:
>>
>> The organisation that i work for is introducing a secure intranet operating on windows PCs and laptops, and this requires that all software / executables / dlls are validated before they are combined to produce a generic PC build.
>>
>> I would like to maximise the packages available to our staff and so for the packages that we have listed as buisness needs, i would like to include all reverse dependencies of this collection that do not have dlls.
>>
>> I hope this makes sense (the question not the reason).
>>
>> Kind regards,
>> Colin.
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at 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.
>>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list