dfm_sort | R Documentation |
Sorts a dfm by descending frequency of total features, total features in documents, or both.
dfm_sort(x, decreasing = TRUE, margin = c("features", "documents", "both"))
x |
Document-feature matrix created by |
decreasing |
logical; if |
margin |
which margin to sort on |
A sorted dfm matrix object
Ken Benoit
dfmat <- dfm(tokens(data_corpus_inaugural))
head(dfmat)
head(dfm_sort(dfmat))
head(dfm_sort(dfmat, decreasing = FALSE, "both"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.