Thank you all for the suggestions. Creating a vector with the species works
very well. :)
2015-07-15 17:59 GMT+01:00 Sergio Ferreira Cardoso <
sff.card...@campus.fct.unl.pt>:
> Thank you very much Nicholas. Works perfectly!!! :)
>
> 2015-07-15 17:22 GMT+01:00 Nicholas Crouch :
>
>> Sergio,
>>
>>
Have you looked into drop.tip from ape? if your labels you are interested
in a vector, tip this should work:
smalltree <- drop.tip(tree, which(!(tree$tip.label %in% tip)))
Regards,
Klaus
On Wed, Jul 15, 2015 at 12:15 PM, Sergio Ferreira Cardoso <
sff.card...@campus.fct.unl.pt> wrote:
> Dear me
Hi Sergio,
one way to do it (maybe not the fastest) would be to create a vector with
all the tips you want to drop.
If 'my_59_tips' is a vector with the 59 tips you want to keep and 'tree' is
the large tree, the following should work:
tips_to_drop<-tree$tip.label[-which(tree$tip.label%in%my_59_ti
Hi Sergio,
The simplest way to do this in R is just to set the rownames of your data
frame to be the species names and use
library(geiger)
res <- treedata(your_tree, your_data)
pruned_tree <- res$phy
This is going to be a bit slow but shouldn't be too bad if you are only
doing it a few times.
Dear members,
I have a tree with almost 10.000 species and I want to prune it. The
problem is I only want a tree with 59 of those species. Is there any
possible way to make this in R? Is there any code to prune all taxa except
the ones on my data?
Thanks in advance.
Best regards,
Sérgio.
--
Co