roger koenker wrote: > Is there a painless way to find the names of all packages on CRAN > that "Depend" on a specified package? > Depends on how accurately you need them. These *probably* depend on "boot"
> x <- available.packages() > rownames(x)[grep("boot",x[,"Depends"])] [1] "circular" "cramer" "DCluster" "equivalence" "np" [6] "pastecs" "relaimpo" "sensitivity" "simpleboot" "spdep" [11] "survrec" "titan" "verification" "Zelig" This allows visual inspection of the Depends fields too: x[grep("boot",x[,"Depends"]), "Depends", drop=F] (There could have been dependencies on, say, simpleboot). For increased precision, you'll need to grep more carefully, for "\\<boot\\>". Finally, catching indirect dependencies requires iterative application, something like this: > f <- function(s) rownames(x)[grep(paste("\\<",s,"\\>",sep=""),x[,"Depends"])] > (y <- f("boot")) [1] "circular" "cramer" "DCluster" "equivalence" "np" [6] "pastecs" "relaimpo" "sensitivity" "simpleboot" "spdep" [11] "survrec" "titan" "verification" "Zelig" > (y0 <- unlist(lapply(y,f))) [1] "wle" "DCluster" "svcR" "gcmrec" "VDCutil" > (y0 <- setdiff(y0,y)) [1] "wle" "svcR" "gcmrec" "VDCutil" > (y <- union(y, y0)) [1] "circular" "cramer" "DCluster" "equivalence" "np" [6] "pastecs" "relaimpo" "sensitivity" "simpleboot" "spdep" [11] "survrec" "titan" "verification" "Zelig" "wle" [16] "svcR" "gcmrec" "VDCutil" > (y0 <- unlist(lapply(y0,f))) character(0) ...and stop at this point since there are no more dependents. Otherwise, repeat. -- O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ R-help@stat.math.ethz.ch 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.