term_freq: term_freq

Description Usage Arguments Value Examples

View source: R/terms.R

Description

Study frequencies of chosen terms in the corpus, among documents, or among levels of

Usage

1
term_freq(dtm, terms, variable = NULL, by_term = FALSE)

Arguments

dtm

A DocumentTermMatrix.

terms

One or more reference term(s) appearing in dtm.

variable

An optional vector of values giving the groups for which most frequent terms should be reported.

by_term

Whether the third dimension of the array should be terms instead of levels.

Value

A list of matrices, one for each level of the variable, with columns:

Examples

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)
term_freq(dtm, "barrel")
term_freq(dtm, "barrel", meta(corpus)$Date)

R.temis documentation built on May 13, 2021, 1:08 a.m.

Related to term_freq in R.temis...