Re: [R] accessing the "address" of items in a recursive list

2008-01-22 Thread phlow
j daniel wrote: > > > I would like to print the "address" of the smaller dendrograms on the edge > similar to this: > > addr <- function(n) { > if(!is.leaf(n)) { > attr(n, "edgetext") <- paste("height of",(attr(n,"height")) > } > n > } > labeledDends <- dendrapply(de

Re: [R] accessing the "address" of items in a recursive list

2008-01-22 Thread phlow
j daniel wrote: > > > I would like to print the "address" of the smaller dendrograms on the edge > similar to this: > > addr <- function(n) { > if(!is.leaf(n)) { > attr(n, "edgetext") <- paste("height of",(attr(n,"height")) > } > n > } > labeledDends <- dendrapply(de

Re: [R] dendrogram - got it , just need to label :)

2008-01-22 Thread phlow
Hi! To label your dendrogram edges with the path to each of them, execute the following script (assuming that your dendrogram is 'dend', see last 2 lines). dendrapplyGlobal <- function(dend,attrName,FUN,...,attrNameTo=NULL) { if (is.null(attrNameTo)) { attrNameTo <- attr