drop0 {Matrix} | R Documentation |
Returns a sparse matrix with no “explicit zeroes”, i.e., all
zero or FALSE
entries are dropped from the explicitly indexed
matrix entries.
drop0(x, clx = c(class(x)))
x |
a Matrix, typically sparse, i.e., inheriting from
sparseMatrix . |
clx |
[optional:] the class or “class
definition” (see getClassDef ; it is of class
classRepresentation ) of x .This argument just exists for the possibility of speedup. |
a Matrix like x
but with no explicit zeros, i.e.,
!any(x@x == 0)
, always inheriting from
CsparseMatrix
.
spMatrix
, class sparseMatrix
m <- spMatrix(10,20, i= 1:8, j=2:9, x = c(0:2,3:-1)) m drop0(m)