Is there a painless way to find the names of all packages on CRAN that "Depend" on a specified package? url: www.econ.uiuc.edu/~roger Roger Koenker email rkoenker at uiuc.edu Department of Economics vox: 217-333-4558 University of Illinois fax: 217-244-6678 Champaign, IL 61820
Try this, noting that available.packages() returns a matrix whose columns include "Depends" and "Suggests" and whose rownames are the package names:> AP <- available.packages() > rownames(AP)[grep("quantreg", AP[, "Depends"])][1] "cobs" "emplik" "lss" "rankreg" "rqmcmb2"> rownames(AP)[grep("quantreg", AP[, "Suggests"])][1] "apTreeshape" "diveMove" "dyn" "ggplot" "gsubfn" [6] "np" On 1/2/07, roger koenker <rkoenker at uiuc.edu> wrote:> Is there a painless way to find the names of all packages on CRAN > that "Depend" on a specified package? > > > url: www.econ.uiuc.edu/~roger Roger Koenker > email rkoenker at uiuc.edu Department of Economics > vox: 217-333-4558 University of Illinois > fax: 217-244-6678 Champaign, IL 61820 > > ______________________________________________ > R-help at 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. >
Hello, http://bioconductor.org/packages/1.9/bioc/html/pkgDepTools.html resp. http://bioconductor.org/packages/2.0/bioc/html/pkgDepTools.html may help you. Best regards, Matthias Gabor Grothendieck schrieb:> Try this, noting that available.packages() returns a matrix whose columns > include "Depends" and "Suggests" and whose rownames are the package > names: > > >> AP <- available.packages() >> rownames(AP)[grep("quantreg", AP[, "Depends"])] >> > [1] "cobs" "emplik" "lss" "rankreg" "rqmcmb2" > >> rownames(AP)[grep("quantreg", AP[, "Suggests"])] >> > [1] "apTreeshape" "diveMove" "dyn" "ggplot" "gsubfn" > [6] "np" > > On 1/2/07, roger koenker <rkoenker at uiuc.edu> wrote: > >> Is there a painless way to find the names of all packages on CRAN >> that "Depend" on a specified package? >> >> >> url: www.econ.uiuc.edu/~roger Roger Koenker >> email rkoenker at uiuc.edu Department of Economics >> vox: 217-333-4558 University of Illinois >> fax: 217-244-6678 Champaign, IL 61820 >> >> ______________________________________________ >> R-help at 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. >> >> > > ______________________________________________ > R-help at 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. >-- Dr. rer. nat. Matthias Kohl E-Mail: matthias.kohl at stamats.de Home: www.stamats.de
On Tue, 2 Jan 2007 11:20:10 -0600, roger koenker <rkoenker at uiuc.edu> wrote:> Is there a painless way to find the names of all packages on CRAN that > "Depend" on a specified package?Maybe this is not too painful: pkgs <- available.packages() # repos arg may be useful here pkgs.dpnd <- pkgs[grep("quantreg", pkgs[, "Depends"]), ] names(pkgs.dpnd) -- Seb
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 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
On Tue, 2 Jan 2007, roger koenker wrote:> Is there a painless way to find the names of all packages on CRAN > that "Depend" on a specified package?Assuming you have just CRAN in your selected repositories:> foo <- available.packages() > deps <- strsplit(foo[, "Depends"], ",[[:space:]]*") > names(deps)[sapply(deps, function(x) "quantreg" %in% x)][1] "cobs" "emplik" "lss" "pheno" "rankreg" "rqmcmb2" seems painless enough. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Hi everybody, I'm trying to do a statistic on the error rate of a prediction algorithm. suppose this is the real category [good, good, bad, bad, good, good, bad, bad] this is the predicted category [good, bad, bad, bad, good, good, good, bad] I'm trying to do a statistic on the error rate for each group("good","bad"): what percentage of instances are predicted incorrectly for each group ? Of course I can write a loop to do that, but is there a easy way to do that? Thank you! Best, Feng