Given a binary matrix Z with fixed rows, `lof` left orders the matrix sequentially based on first occurrence of each row

lof(Z, indices = FALSE)

Arguments

Z

a binary matrix

indices

a logical parameter whether to return the column order (`TRUE`) or to return the left-ordered matrix. Defautl is `TRUE`.

Value

return the left-ordered matrix, or a vector of indexing the order of columns

Examples

Z <- matrix(rbinom(10*30, 1, 0.1), nrow=10, ncol=30) Zord = lof(Z)