sort.freqlist {mclm} | R Documentation |
Sort a frequency list
Description
This method sorts an object of class freqlist
.
Usage
## S3 method for class 'freqlist'
sort(
x,
decreasing = FALSE,
sort_crit = c("ranks", "names", "orig_ranks", "freqs"),
na_last = TRUE,
...
)
Arguments
x |
Object of class |
decreasing |
Logical. If Note, however, that ranking in frequency lists is such that lower ranks
correspond to higher frequencies. Therefore, sorting by rank (either
|
sort_crit |
Character string determining the sorting criterion. If If If Finally, sorting with |
na_last |
Logical defining the behavior of This argument is only relevant when If |
... |
Additional arguments. |
Details
Because of the way ranks are calculated for ties (with lower ranks being assigned to ties earlier in the list), sorting the list may affect the ranks of ties. More specifically, ranks among ties may differ depending on the criterion that is used to sort the frequency list.
Value
Object of class freqlist
.
Examples
(flist <- freqlist(tokenize("the old story of the old man and the sea.")))
sort(flist)
sort(flist, decreasing = TRUE)