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

Reply via email to