Hello, I am trying to remove nodes from a dendrogram - specifically nodes that have less than 3 members. I am trying to create a function to do so, but I am not sure how to reference the node inside of the function. Here is the code: rem.nodes <<- function(n) { if(!is.leaf(n) & attr(n, "members")<3) { REMOVE N ?? } } reduced.dend <- dendrapply(dend1, rem.nodes) Any ideas are appreciated. Jesse [[alternative HTML version deleted]]
> > Hello, >I am trying to remove nodes from a dendrogram - specifically nodes that> have less than 3 members. I am trying to create a function to do so, but I > am not sure how to reference the node inside of the function. Here is the > code: > > rem.nodes <<- function(n) { > if(!is.leaf(n) & attr(n, "members")<3) { > > REMOVE N ?? } } > > reduced.dend <- dendrapply(dend1, rem.nodes) > > Any ideas are appreciated. > > Jesse > > >[[alternative HTML version deleted]]