Skip to content

Instantly share code, notes, and snippets.

@wandabwa2004
Created August 6, 2019 09:23
Show Gist options
  • Save wandabwa2004/e6461ef18a71d8e3f334f5ea7dfe54c8 to your computer and use it in GitHub Desktop.
Save wandabwa2004/e6461ef18a71d8e3f334f5ea7dfe54c8 to your computer and use it in GitHub Desktop.
#Word frequency and topic models
freq <- colSums(as.matrix(dtm))
ord <- order(-freq)
freq[head(ord)]
freq[tail(ord)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment