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)

oslerinhealth/rewind documentation built on May 26, 2019, 9:36 a.m.