content_transformer
From tm v0.6-2
by Ingo Feinerer
Content Transformers
Create content transformers, i.e., functions which modify the content of an R object.
Usage
content_transformer(FUN)
Arguments
- FUN
- a function.
Value
See Also
tm_map
for an interface to apply transformations to corpora.
Examples
data("crude")
crude[[1]]
(f <- content_transformer(function(x, pattern) gsub(pattern, "", x)))
tm_map(crude, f, "[[:digit:]]+")[[1]]
Community examples
mani-yuki@hotmail.co.jp
at
Jun 12, 2019
tm
v0.7-6
# NOT RUN { data("crude") crude[[1]] (f <- content_transformer(function(x, pattern) gsub(pattern, "", x))) tm_map(crude, f, "[[:digit:]]+")[[1]] # }