Learn R Programming

quanteda (version 0.99)

sort.dfm: sort a dfm by one or more margins

Description

Sorts a dfm by frequency of total features, total features in documents, or both

Usage

# S3 method for dfm
sort(x, decreasing = TRUE, margin = c("features", "docs",
  "both"), ...)

Arguments

x

Document-feature matrix created by dfm

decreasing

TRUE (default) if sort will be in descending order, otherwise sort in increasing order

margin

which margin to sort on features to sort by frequency of features, docs to sort by total feature counts in documents, and both to sort by both

...

additional arguments passed to base method sort.int

Value

A sorted dfm matrix object

See Also

dfm_sort