tm (version 0.6-1)

content_transformer: Content Transformers

Description

Create content transformers, i.e., functions which modify the content of an Robject.

Usage

content_transformer(FUN)

Arguments

FUN
a function.

Value

  • A function with two arguments: [object Object],[object Object]

See Also

tm_map for an interface to apply transformations to corpora.

Examples

Run this code
data("crude")
crude[[1]]
(f <- content_transformer(function(x, pattern) gsub(pattern, "", x)))
tm_map(crude, f, "[[:digit:]]+")[[1]]

Run the code above in your browser using DataLab