Description Usage Arguments Value Examples
List terms with the highest number of occurrences in the document-term matrix of a corpus, possibly grouped by the levels of a variable.
1 | frequent_terms(dtm, variable = NULL, n = 25)
|
dtm |
A |
variable |
An optional vector of values giving the groups for which most frequent terms should be reported. |
n |
The maximal number of terms to report (for each group, if applicable). |
A list of matrices, one for each level of the variable, with columns:
"\
"\ (rather than in other levels).
"Global \
"Level": the number of occurrences of the term in the level ("internal").
"Global": the number of occurrences of the term in the corpus.
"t value": the quantile of a normal distribution corresponding the probability "Prob.".
"Prob.": the probability of observing such an extreme (high or low) number of occurrences of the term in the level, under an hypergeometric distribution.
1 2 3 4 5 | file <- system.file("texts", "reut21578-factiva.xml", package="tm.plugin.factiva")
corpus <- import_corpus(file, "factiva", language="en")
dtm <- build_dtm(corpus)
frequent_terms(dtm)
frequent_terms(dtm, meta(corpus)$Date)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.