Learn R Programming

tm.plugin.dc (version 0.2-10)

tm_map.DCorpus: Transformations on Distributed Corpora

Description

Interface to apply transformation functions to distributed corpora. See tm_map in tm for more information.

Usage

# S3 method for DCorpus
tm_map(x, FUN, …)

Arguments

x

A distributed corpus of class DCorpus.

FUN

a transformation function taking a text document as input and returning a text document. The function content_transformer can be used to create a wrapper to get and set the content of text documents.

arguments to FUN.

Value

A DCorpus with FUN applied to each document in x. If revisions are enabled, the original documents contained in x can be retrieved via getting back to the corresponding revision using the function setRevision().

See Also

getTransformations for available transformations in package tm.

Examples

Run this code
# NOT RUN {
data("crude")
tm_map(as.DCorpus(crude), content_transformer(tolower))
# }

Run the code above in your browser using DataLab