Learn R Programming

SpotSampling (version 0.1.0)

ReducedMatrix: Matrix reduction

Description

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.

Usage

ReducedMatrix(B)

Arguments

B

a matrix that contains lot of 0s.

Value

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.

Examples

Run this code
# 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