Skip to content
Prev 231929 / 398498 Next

spare matrix replacing values efficiently

I am working with a large sparse matrix trying replace all 1 values with 0.  The normal method doesn't work.  Here is a small example:
10 x 10 sparse Matrix of class "dgCMatrix"

[1,] 1 . . . . . . . . .
[2,] 2 . . . . . . . . .
[3,] 1 . . . . . . . . .
[4,] 2 . . . . . . . . .
[5,] 1 . . . . . . . . .
[6,] 2 . . . . . . . . .
[7,] 1 . . . . . . . . .
[8,] 2 . . . . . . . . .
[9,] 1 . . . . . . . . .
[10,] 2 . . . . . . . . .
Error in .local(x, i, j, ..., value) : 
 not-yet-implemented 'Matrix[<-' method


Suggestions?  Any solution must be memory efficient as my sparse matrix is large.

dhs