order_mat_byrow: Order a binary matrix by row

Description Usage Arguments Value Examples

View source: R/utils.R

Description

The order is determined by magnitude of the rows as in a binary system (decreasing)

Usage

1
order_mat_byrow(mat, decreasing = TRUE)

Arguments

mat

A binary matrix to be ordered by row

decreasing

TRUE (default) to order rows in a decreasing order; FALSE otherwise.

Value

a list of res - the ordered matrix from large to small, ord - the order

Examples

1
2
3
themat <- matrix(c(0,1,0,1,0,0,1,1,1,0,1,1),ncol=3)
order_mat_byrow(themat)
order_mat_byrow(themat,decreasing=FALSE)

zhenkewu/rewind documentation built on Sept. 9, 2020, 3:40 p.m.