Skip to main content

builtin_rank

Function builtin_rank 

Source
fn builtin_rank(
    args: &[RValue],
    named: &[(String, RValue)],
) -> Result<RValue, RError>
Expand description

Return the ranks of values in a numeric vector.

Computes the sample ranks of the values. Ties are handled according to the ties.method argument: “average” (default) assigns the mean rank, “first” preserves the original order, “min” uses the minimum rank, and “max” uses the maximum rank.

@param x numeric vector to rank @param ties.method character string: “average”, “first”, “min”, or “max” @return double vector of ranks (1-based)