Re: [R] Scaling rows of a large Matrix::sparseMatrix()

2016-01-13 Thread tomdharray
Hello Gerrit, Thanks. Your proposal works in general, but I get memory allocation errors with my actual 57,000 x 14,000 matrix. The fix which I now use is to scale the data before I build the matrix; see below. Cheers, Dirk ## Code Start - library(parallel) rows

[R] Scaling rows of a large Matrix::sparseMatrix()

2016-01-12 Thread tomdharray
Hello R-Users, I'm looking for a way to scale the rows of a sparse matrix M with about 57,000 rows, 14,000 columns, and 238,000 non-zero matrix elements; see example code below. Usually I'd use the base::scale() function (see sample code), but it freezes my computer. The same happens when I try t