Re: [R-sig-phylo] Adding random branches to tree recursively

2015-11-02 Thread Juan Antonio Balbuena
Thank you very much Liam, You are always so helpful.  I tried you code and get this warning: Warning message: In bind.tree(tree, tip, where = where, position = pp) : one tree has no branch lengths, they have been ignored After adding edge.length=

Re: [R-sig-phylo] Adding random branches to tree recursively

2015-11-01 Thread Liam J. Revell
Hi Eliot & Juan. There is also now an interactive mode for bind.tip. This allows you to click on a plotted tree & bind a tip to that spot. It otherwise works the same as the prior CRAN version of bind.tip. To get this functionality, you need to pull down the latest version of phytools from

[R-sig-phylo] Adding random branches to tree recursively

2015-10-30 Thread Juan Antonio Balbuena
Hello I need to add branches to a tree at different, predefined tips. For instance: th <- rtree(10) I have an object HP_sim$nameH with the taxa names: > HP_sim$nameH  [1] "H1" "H2" "H3" "H4" "H5" "H6" "H7" "H8" "H9" "H10" then

Re: [R-sig-phylo] Adding random branches to tree recursively

2015-10-30 Thread Liam J. Revell
Hola Juan. position is distance below the specified node (or tip) so it has to be less than the the length of the edge to which the tip is being added or else you will get an error. You could modify as follows: node<-which(tree$tip.label==tip.name) tree<-bind.tip(tree,where=node,position=

Re: [R-sig-phylo] Adding random branches to tree recursively

2015-10-30 Thread Eliot Miller
What I'm about to describe is essentially an elaborate wrapper for Liam's bind.tip, so he deserves the credit for figuring this all out. But if you are interested, I have a small package on GitHub that will automate this for you. It probably doesn't make much difference with so few taxa you need