tm_map.DCorpus {tm.plugin.dc}R Documentation

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 class '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

data("crude")
tm_map(as.DCorpus(crude), content_transformer(tolower))

[Package tm.plugin.dc version 0.2-10 Index]