Sort a dfm by frequency of one or more margins
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(data_corpus_inaugural) head(dfmat) head(dfm_sort(dfmat)) head(dfm_sort(dfmat, decreasing = FALSE, "both"))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.