R/distancia.R

Defines functions distancia

Documented in distancia

distancia <-
function (x, y) 
{#Find out the row in y that is closer to x using eucldean distance 
    if (class(y) == "matrix") {
        distancia = drop(sqrt(colSums((x - t(y))^2)))
        distancia = t(distancia)
    }
    else distancia = sqrt(sum((x - y)^2))
    distancia
}

Try the dprep package in your browser

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

dprep documentation built on May 29, 2017, 11:01 a.m.