R/sisterMatrix.R

Defines functions sisterMatrix

sisterMatrix <- function(phylo){
	binarisePenult <- function(vector){
		xx <- vector
		vector[which(xx != max(xx) - 1)] <- 0
		vector[which(xx == max(xx) - 1)] <- 1
		vector
	}
	
	vcvp <- vcv(phylo)
	vcvpInt <- apply(vcvp, 2, function(xx) as.numeric(as.factor(xx)))
	vcvpBin <- apply(vcvpInt, 2, binarisePenult)
	vcvpBin
}

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.