Subset matrix rows and columns
Subset the rows and columns of a matrix by removing rows and columns with less than the specified number of non-zero elements.
SubsetMatrix( mat, min.rows = 1, min.cols = 1, max.row.val = 10, max.col.val = NULL )
mat
: A matrixmin.rows
: Minimum number of non-zero elements for the row to be retainedmin.cols
: Minimum number of non-zero elements for the column to be retainedmax.row.val
: Maximum allowed value in a row for the row to be retained. If NULL, don't set any limit.max.col.val
: Maximum allowed value in a column for the column to be retained. If NULL, don't set any limit.Returns a matrix
SubsetMatrix(mat = volcano)
Useful links