R/single.cut.R

Defines functions single.cut

Documented in single.cut

single.cut <- function(A, clusters, K = 2){
	
	ratio.count = 0
	normalised.count = 0
	temp.diag = apply(A, 2, sum)
	for(i in 1:K){
		temp.label = which(clusters == i)
		t1 = sum(A[temp.label, -temp.label])
		ratio.count = ratio.count + t1/length(temp.label)
		normalised.count = normalised.count + t1/sum(temp.diag[temp.label])
	}
	
	return(list(ratio.count = ratio.count, normalised.count = normalised.count))
}

Try the FusedPCA package in your browser

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

FusedPCA documentation built on May 29, 2017, 9:19 p.m.