Sort a matrix in a row- or column-wise manner, or check that it isrowSort sort each row independentlycolSort sort each column independentlyrowSorted check that each row is independently sortedcolSorted check that each column is independently sorted
Usage
rowSort(mat, by = NULL, ncol = NULL, decreasing = FALSE)
colSort(mat, by = NULL, ncol = NULL, decreasing = FALSE)
rowSorted(mat, decreasing = FALSE)
colSorted(mat, decreasing = FALSE)