I\'ve got a sparse Matrix
in R that\'s apparently too big for me to run as.matrix()
on (though it\'s not super-huge either). The as.matrix()
So here's what I ended up doing. It's relatively straightforward to write a routine that dumps a sparse matrix (class dgCMatrix
) to a text file in SVDLIBC's "sparse text" format, then call the svd
executable, and read the three resultant text files back into R.
The catch is that it's pretty inefficient - it takes me about 10 seconds to read & write the files, but the actual SVD calculation takes only about 0.2 seconds or so. Still, this is of course way better than not being able to perform the calculation at all, so I'm happy. =)