Skip to content

Instantly share code, notes, and snippets.

@zunman
Created September 11, 2016 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zunman/8912306465e43b2f2c9931df544dbd79 to your computer and use it in GitHub Desktop.
Save zunman/8912306465e43b2f2c9931df544dbd79 to your computer and use it in GitHub Desktop.
#convert sparse dtm to data.frame
data.DTM <- as.data.frame(as.matrix(sparse_DTM))
#append label column
data.DTM$label <- data$label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment