R/KillAllDuplicates.R

KillAllDuplicates <- function(phy) {
	taxon.counts <- sort(table(phy$tip.label))
	if(length(which(taxon.counts>1))>0) {
		taxa.to.kill <- names(taxon.counts[which(taxon.counts>1)])
		phy <- drop.tip(phy, taxa.to.kill)
	}
	return(phy)
}
bomeara/prepotol documentation built on May 12, 2019, 11:36 p.m.