Re: [R] package dependency tree

2007-01-02 Thread Seth Falcon
Matthias Kohl <[EMAIL PROTECTED]> writes:

> 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.

[shameless plug]

Last Month's RNews has an article that demonstrates the pkgDepTools
package:

[144] Seth Falcon. Modeling package dependencies using graphs. R News,
6(5):8-12, December 2006.

+ seth

__
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.


Re: [R] package dependency tree

2007-01-02 Thread Prof Brian Ripley
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,  [EMAIL PROTECTED]
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, UKFax:  +44 1865 272595

__
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.


Re: [R] package dependency tree

2007-01-02 Thread Peter Dalgaard
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 "\\". 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.


Re: [R] package dependency tree

2007-01-02 Thread Sebastian P. Luque
On Tue, 2 Jan 2007 11:20:10 -0600,
roger koenker <[EMAIL PROTECTED]> 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

__
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.


Re: [R] package dependency tree

2007-01-02 Thread Matthias Kohl
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 <[EMAIL PROTECTED]> 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/~rogerRoger Koenker
>> email[EMAIL PROTECTED]Department of Economics
>> vox: 217-333-4558University of Illinois
>> fax:   217-244-6678Champaign, IL 61820
>>
>> __
>> 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.
>>
>> 
>
> __
> 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.
>   


-- 
Dr. rer. nat. Matthias Kohl
E-Mail: [EMAIL PROTECTED]
Home: www.stamats.de

__
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.


Re: [R] package dependency tree

2007-01-02 Thread Gabor Grothendieck
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 <[EMAIL PROTECTED]> 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/~rogerRoger Koenker
> email[EMAIL PROTECTED]Department of Economics
> vox: 217-333-4558University of Illinois
> fax:   217-244-6678Champaign, IL 61820
>
> __
> 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.
>

__
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.


[R] package dependency tree

2007-01-02 Thread roger koenker
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/~rogerRoger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820

__
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.