Learn R Programming

tm (version 0.4)

tmReduce: Combine Transformations

Description

Combine multiple transformations (mappings) into a single one.

Usage

tmReduce(x, tmFuns, ...)

Arguments

x
a corpus.
tmFuns
a list of tm transformations.
...
arguments to the individual transformations.

Value

  • A single tm transformation function.

See Also

Use getTransformations to list available transformation (mapping) functions.

Examples

Run this code
data(crude)
crude[[1]]
skipWords <- function(x, ...) removeWords(x, c("it", "the"))
funs <- list(tmTolower, removePunctuation, skipWords, stripWhitespace)
tmMap(crude, FUN = tmReduce, tmFuns = funs)[[1]]

Run the code above in your browser using DataLab