R/make.distmat.R

"make.distmat" <-
function(X) {
	X <- t(X)
	return(sqrt(abs(sweep(sweep(-2*t(X)%*%X, 1, colSums(X*X), "+"), 2, colSums(X*X), "+"))))
}

Try the loe package in your browser

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

loe documentation built on May 2, 2019, 3:28 a.m.