My suggestion below should work with trees initially with zero-length branch if using a negative value instead of 0, e.g.:
tr$edge.length[j] <- -1 Then di2multi(tr, tol = -0.5) Emmanuel -----Original Message----- From: "Emmanuel Paradis" <emmanuel.para...@ird.fr> Sender: r-sig-phylo-boun...@r-project.org Date: Wed, 28 Sep 2011 14:10:55 To: Daniel Rafael Miranda-Esquivel<dmira...@uis.edu.co>; <r-sig-phylo-boun...@r-project.org>; <r-sig-phylo@r-project.org> Reply-To: emmanuel.para...@ird.fr Subject: Re: [R-sig-phylo] Collapsing nodes using node.labels Hello Daniel, Try this small manipulation ('tr' is your tree and 'node' stores the label of the node): i <- which(tr$node.label == node) j <- which(tr$edge[, 2] == i + Ntip(tr)) tr$edge.length[j] <- 0 Then di2multi(tr) will do the job. (Hopefully, there's originally no zero-length branch in tr.) HTH Emmanuel -----Original Message----- From: Daniel Rafael Miranda-Esquivel <dmira...@uis.edu.co> Sender: r-sig-phylo-boun...@r-project.org Date: Wed, 28 Sep 2011 00:21:43 To: <r-sig-phylo@r-project.org> Subject: [R-sig-phylo] Collapsing nodes using node.labels Hello all, I am trying to collapse some nodes in a tree but using node.label and not edge.length, is there a way to convert node.label to edge.length? or a function to collapse a node but using node.label directly? Daniel _______________________________________________ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo _______________________________________________ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo _______________________________________________ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo