tm_reduce

0th

Percentile

Combine Transformations

Fold multiple transformations (mappings) into a single one.

Usage
tm_reduce(x, tmFuns, ...)
Arguments
x
A corpus.
tmFuns
A list of tm transformations.
...
Arguments to the individual transformations.
Value

A single tm transformation function obtained by folding tmFuns from right to left (via Reduce(..., right = TRUE)).

See Also

Reduce for R's internal folding/accumulation mechanism, and getTransformations to list available transformation (mapping) functions.

Aliases
  • tm_reduce
Examples
data(crude)
crude[[1]]
skipWords <- function(x) removeWords(x, c("it", "the"))
funs <- list(stripWhitespace,
             skipWords,
             removePunctuation,
             content_transformer(tolower))
tm_map(crude, FUN = tm_reduce, tmFuns = funs)[[1]]
Documentation reproduced from package tm, version 0.6-2, License: GPL-3

Community examples

Looks like there are no examples yet.