Learn R Programming

tm (version 0.3-3)

termFreq: Term Frequency Vector

Description

Generate a term frequency vector from a text document.

Usage

termFreq(doc, control = list())

Arguments

doc
An object inheriting from TextDocument.
control
A list of control options. Possible settings are
  • tolower: A function converting characters to lower case. Defaults tobase::tolower.
  • tokenize: A function tokenizing documents to single

Value

  • A named integer vector with term frequencies as values and tokens as names.

Examples

Run this code
data("crude")
termFreq(crude[[1]])
termFreq(crude[[1]], control = list(stemming = TRUE, minWordLength = 4))

Run the code above in your browser using DataLab