Displaying 1 result from an estimated 1 matches for "xsparse".
Did you mean:
sparse
2008 Jun 17
0
Quickly reading data into the Matrix packages sparse formats
...e to time so far. However, before
I can solve my full linear model, I need to be able to read in all
the data, and therein lies the rub. There are two ways that I see to
read it in:
(1) generate a dense X matrix and then convert it to a sparse matrix
using i.e.
R> require(Matrix)
R> Xsparse <- as(X,"dgCMatrix")
(2) make a new sparse X matrix and then populate it.
R> require(Matrix)
R> Xsparse <- Matrix(0,nrow=n,ncol=m,sparse=T)
then for relevant cells:
R> Xsparse[i,j] <- v
But both of these methods are painfully slow. method 1 takes many
times as long...