tmMap-methods {tm}R Documentation

Methods for Function tmMap in Package ‘tm’

Description

Methods for function tmMap in package tm.

Methods

object = "Corpus", FUN
Applies FUN onto each element of object. Note that document specific metadata (i.e., DMetaData(object) is automatically passed to FUN as argument DMetaData. FUN must be a function which returns a TextDocument.

See Also

See getTransformations for available transformations shipped with tm.

Examples

data("crude")
tmMap(crude, stemDoc)

headings <- function(object, ...) {
new("PlainTextDocument", Heading(object), Cached = TRUE, DateTimeStamp =
Sys.time(), ID = ID(object), Language = Language(object))
}
inspect(tmMap(crude, headings))

[Package tm version 0.3 Index]