R/termBalance.R

Defines functions termBalance

termBalance <- function(phylo){
	tipLab <- phylo$tip.label
	TBind <- match(1:length(tipLab), phylo$edge[,2])
	bal <- polyBalance(phylo)
	nodeind <- phylo$edge[TBind,1]
	balspp <- apply(bal[match(nodeind, as.numeric(dimnames(bal)[[1]])),], 1, max)
	names(balspp) <- tipLab
	balspp
}

Try the spiderDev package in your browser

Any scripts or data that you put into this service are public.

spiderDev documentation built on May 2, 2019, 5:23 p.m.