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
th$tip.label <- HP_sim$nameH    

In a second object, I have the tips where the branches should be added:

> HP_sim$fai
 
[1] 1 4 7 9 10

(That is at H1, H4, H7, H9 and H10)

Now I wrote this syntax (where n.fai = 5):

for (i in 1:n.fai) th <- bind.tip(th, HP_sim$nameH[HP_sim$fai[i]],
                         where = which(th$tip.label==HP_sim$nameH[HP_sim$fai[i]]), edge.length= runif(1), position=runif(1))

However, it doesn't work and get this error:

Error in bind.tree(tree, tip, where = where, position = pp) : 'position' is larger than the branch length

Any help would be very much appreciated.

Thank you very much for your attention

Juan A. Balbuena







--

Dr. Juan A. Balbuena
Cavanilles Institute of Biodiversity and Evolutionary Biology
University of Valencia                                           
http://www.uv.es/~balbuena
P.O. Box 22085                                                   
http://www.uv.es/cophylpaco
46071 Valencia, Spain

e-mail:
j.a.balbu...@uv.es    tel. +34 963 543 658    fax +34 963 543 733
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

NOTE! For shipments by EXPRESS COURIER use the following street address:
C/ Catedrático José Beltrán 2, 46980 Paterna (Valencia), Spain.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to