Column-wise tied ranks of a matrix
rank_matrix.RdRanks the entries of each column independently using the average
rank for ties, and returns the per-column tie group sizes needed
for the Wilcoxon variance correction. Used internally by
wilcoxauc() (on a transposed input, so that rows become
observations) but exposed as a fast standalone ranking primitive
for sparse and dense numeric matrices.
Usage
rank_matrix(X)
# S3 method for class 'dgCMatrix'
rank_matrix(X)
# S3 method for class 'matrix'
rank_matrix(X)Value
List with two elements:
X_ranked- matrix with the same shape asXcontaining per-column tied ranks.ties- list of integer vectors, one per column, giving the sizes of all tie groups encountered in that column. Used by the Wilcoxon statistic to correct for ties.