R/dista.R

Defines functions dista

Documented in dista

#[export]
dista <- function(xnew,x,type = "euclidean",k=0,index=FALSE,trans = TRUE,square = FALSE) {
	if(k>0){
		if(index){
			x <- .Call(Rfast_dista_index,t(xnew),t(x),k,type)
		}else{
			x <- .Call(Rfast_dista_values,t(xnew),t(x),k,square,type)
		}
	}else{
		x <- .Call(Rfast_dista,t(xnew),t(x),square,type)
	}
	if(trans)	x <- t(x)
	x
}

Try the Rfast package in your browser

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

Rfast documentation built on March 18, 2022, 7:41 p.m.