powered by
Create content transformers, i.e., functions which modify the content of an R object.
content_transformer(FUN)
a function.
A function with two arguments:
x
an R object with implemented content getter (content) and setter (content<-) functions.
content
content<-
…
arguments passed over to FUN.
FUN
tm_map for an interface to apply transformations to corpora.
tm_map
# NOT RUN { 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