R/RANK.R

Defines functions RANK

Documented in RANK

#' @export

RANK <-
function(x){
    # Produces ranking of consecutive integers from (1:unique(x))-1
    r.x=rank(x)
    index=1:length(r.x)
    index=index[order(r.x)]
    r.x=sort(r.x)
    r.x=c(0,cumsum(sign(diff(rank(r.x)))))
    r.x[order(index)]+1
}

Try the CLAST package in your browser

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

CLAST documentation built on April 8, 2022, 9:06 a.m.