R/top.R

Defines functions top

Documented in top

top <-
function (O, neighbors, n) 
{
    temp = as.matrix(apply(neighbors, 1, sum))
    out = rbind(O, temp)
    out = as.matrix(out)
    rowsn = as.numeric(rownames(out))
    rowsno = rowsn[order(out, decreasing = TRUE)]
    out.sort = as.matrix(out[order(-out)])
    rownames(out.sort) = rowsno
    outliers = as.matrix(out.sort[1:n, ])
    return(outliers)
}

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.