#to make subtrees from phylogeny file (phy) and species vector subTree<- function(phy,species) { all.in<-is.na(match(species,phy$tip.label)) if (sum(all.in)>0) paste("species",as.character(species[all.in]), "not in phylogeny") dropme<-phy$tip.label[!phy$tip.label %in% unique(species)] sub.tr<-drop.tip(phy,dropme) }