Description Usage Arguments Value See Also Examples
Fold multiple transformations (mappings) into a single one.
1 |
x |
A corpus. |
tmFuns |
A list of tm transformations. |
... |
Arguments to the individual transformations. |
A single tm transformation function obtained by folding tmFuns
from right to left (via Reduce(..., right = TRUE)
).
Reduce
for R's internal folding/accumulation mechanism, and
getTransformations
to list available transformation
(mapping) functions.
1 2 3 4 5 6 7 8 | 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]]
|
Loading required package: NLP
<<PlainTextDocument>>
Metadata: 15
Content: chars: 527
<<PlainTextDocument>>
Metadata: 15
Content: chars: 473
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.