
Reduce a matrix by removing alternatively columns and rows that sum to 0. If the matrix is dense or if every columns sum to more than 0, then nothing is changed.
ReducedMatrix(B)
a matrix that contains lot of 0s.
Returns a list including:
BB
the reduced matrix of B
.
ind_col
a vector that contains the index of the remaining columns of B
in BB
.
ind_row
a vector that contains the index of the remaining rows of B
in BB
.
# NOT RUN {
set.seed(1)
B <- matrix(sample(c(0,0,0,1),80,replace=TRUE), nrow = 8, ncol = 10)
ReducedMatrix(B)
# }
Run the code above in your browser using DataLab