term_freq {R.temis}R Documentation

term_freq

Description

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

Usage

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


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)


[Package R.temis version 0.1.3 Index]