Another possibility would be addSingleTip() and addTips() from the megaptera 
package ( The latter function can add any 
number of tips; the loop that Liam mentioned is already build into that 
function. This is potentially very slow, but for your tree size it should work. 
Note that you have to specify the 'tax' argument; it allows you to add tips 
also to internal nodes of higher rank than genera. In your case where you have 
only genera you can create 'tax' easily like this:

## 'species' is a vector of tip labels that you want to add
## will work only if your tip labels are of the form 
tax <- data.frame(genus = strip.spec(species),
        species = species,
        stringsAsFactors = FALSE)

Christoph Heibl
An der Weiherleite 3
86633 Neuburg an der Donau      
08431-53 96 534 (Festnetz)
0176-23 86 57 92 (Mobil)

Am 19.06.2017 um 14:06 schrieb Liam Revell:

> The function may do what you want. It adds a single 
> species to the group defined by the MRCA of members of a genus, according to 
> multiple criteria (randomly and so on). It can add only one species at a 
> time, so you will need to write a for loop or something to iterate over the 
> species that you�d like to add.
> --
> Liam J. Revell, Associate Professor of Biology
> University of Massachusetts Boston
> web:
> email:
> Sent from my Windows 10 phone
> From: Sergio Ferreira Cardoso<>
> Sent: Monday, June 19, 2017 6:58 AM
> To: r-sig-phylo<>
> Subject: [R-sig-phylo] Add terminal branches to tree
> Hello all,
> I'm using the package 'phytools' to try to add terminal branches to a tree 
> (attached). I tried to use add.everywhere function to add terminal branches. 
> I have 167 terminal taxa inside each of the 7 genera on my tree. Basically, I 
> just wanted to add some dozens of specimens to the end of each branch, but I 
> don't find a way to do it. Is there any tool that would allow me to do this? 
> Like adding 30 branches to 'Phal', adding 25 to 'Phat', etc.
> Thanks in advance.
> --
> Institut des Sciences de l'Evolution
> Universit� de Montpellier
> Place Eug�ne Bataillon
> 34095 Montpellier Cedex 05
> France
> Email:
> Tel: +33 (4 ) 67 14 46 52
>       [[alternative HTML version deleted]]
> _______________________________________________
> R-sig-phylo mailing list -
> Searchable archive at

        [[alternative HTML version deleted]]

R-sig-phylo mailing list -
Searchable archive at

Reply via email to