frequentwords: Frequent words

frequentwordsR Documentation

Frequent words

Description

Most frequent words of the corpus.

Usage

frequentwords(
  corpus,
  nb,
  mincount = 5,
  minphrasecount = NULL,
  ngram = 1,
  lang = "en",
  stopwords = lang,
  excludewords = NULL,
  removesinglechars = TRUE
)

Arguments

corpus

The corpus of documents (a vector of characters) or the vocabulary of the documents (result of function getvocab).

nb

The number of words to be returned.

mincount

Minimum word count to be considered as frequent.

minphrasecount

Minimum collocation of words count to be considered as frequent.

ngram

maximum size of n-grams.

lang

The language of the documents (NULL if no stemming).

stopwords

The language whose stop words are removed ("en", ...), or NULL to keep them. A list of words of your own goes to excludewords.

excludewords

An optional custom vector of additional words to exclude from the vocabulary (e.g. corpus-specific stop words), on top of (or instead of) the language stopwords given through stopwords.

removesinglechars

Whether single-character tokens are removed during cleanup.

Value

The most frequent words of the corpus.

See Also

getvocab

Examples

data (capitals)
frequentwords (capitals, 10, mincount = 2)
vocab = getvocab (capitals, mincount = 2)
frequentwords (vocab, 10)

fdm2id documentation built on Aug. 28, 2026, 9:07 a.m.