Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

colRanks

Column and row-wise ranks


Description

Column and row-wise ranks.

Usage

colRanks(x,method = "average",descending = FALSE,stable = FALSE, parallel = FALSE)
rowRanks(x,method = "average",descending = FALSE,stable = FALSE, parallel = FALSE)

Arguments

x

A mumerical matrix with the data.

parallel

A boolean value for parallel version.

method

a character string for choosing method. Must be one of "average", "min", "max", "first".

descending

A boolean value (TRUE/FALSE) for sorting the vector in descending order. By default sorts the vector in ascending.

stable

A boolean value (TRUE/FALSE) for choosing a stable sort algorithm. Stable means that discriminates on the same elements. Only for the method "first".

Details

For each column or row of a matrix the ranks are calculated and they are returned. The initial matrix is gone.

Value

A matrix with the column or row-wise ranks.

Author(s)

Manos Papadakis

R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.

See Also

Examples

x <- matrnorm(100, 10)
a1 <- colRanks(x)
a2 <- apply(x, 2, rank)
b1 <- rowRanks(x)
b2 <- apply(x, 1, rank)

x<-a1<-a2<-b1<-b2<-NULL

Rfast

A Collection of Efficient and Extremely Fast R Functions

v2.0.1
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Marios Dimitriadis, Stefanos Fafalios, Ioannis Tsamardinos, Matteo Fasiolo, Giorgos Borboudakis, John Burkardt, Changliang Zou, Kleanthi Lakiotaki and Christina Chatzipantsiou.
Initial release
2020-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.