When working with the tm
package in R, it produces a DocumentTermMatrix
or TermDocumentMatrix
as an S3 object of class simple_triplet_matrix
from the package slam
. Now R has various different packages for creating sparse matrices, each of which have packages depending upon themselves. Long back when working with text data I had created two functions to convert a simple_triplet_matrix
to a matrix of class sparseMatrix
(package: Matrix
) and that to a matrix of class matrix.csr
(package: SparseM
). The conversions are simple enough once you have read through the documentation of the three packages but hopefully this will save someone some time.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|