List the most (or least) frequently occuring features in a dfm.

topfeatures(x, n = 10, decreasing = TRUE, ci = 0.95)

Arguments

x

the object whose features will be returned

n

how many top features should be returned

decreasing

If TRUE, return the n most frequent features, if FALSE, return the n least frequent features

ci

confidence interval from 0-1.0 for use if dfm is resampled

Value

A named numeric vector of feature counts, where the names are the feature labels.

Examples

# most frequent features topfeatures(dfm(corpus_subset(data_corpus_inaugural, Year > 1980), verbose = FALSE))
#> Error in get(".SigLength", envir = env): object '.SigLength' not found
topfeatures(dfm(corpus_subset(data_corpus_inaugural, Year > 1980), remove = stopwords("english"), verbose = FALSE))
#> Error in get(".SigLength", envir = env): object '.SigLength' not found
# least frequent features topfeatures(dfm(corpus_subset(data_corpus_inaugural, Year > 1980), verbose = FALSE), decreasing = FALSE)
#> Error in get(".SigLength", envir = env): object '.SigLength' not found