Created
October 7, 2014 22:45
-
-
Save willkurt/e7ddafca09295f13327a to your computer and use it in GitHub Desktop.
DTM -> Sparse matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dtm.to.sm <- function(dtm){ | |
sparseMatrix(i=dtm$i, j=dtm$j,x=dtm$v, | |
dims=c(dtm$nrow, dtm$ncol)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment