R package dependencies
Thanks guys!
The tools functions are very useful, and also the the
utils:::.clean_up_dependencies hiding in there, which I had a managed to
do myself but in far more lines!
I think I am going to download each zip file one by one to find if there
are dlls - which sounds like an overnight job to me.
Many thanks again,
Colin.
-----Original Message-----
From: Uwe Ligges [mailto:ligges at statistik.tu-dortmund.de]
Sent: 14 January 2010 14:06
To: Colin Millar
Cc: Gabor Grothendieck; r-help at r-project.org
Subject: Re: [R] R package dependencies
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","spli
nes","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.
______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email