Learn R Programming

tm.plugin.dc (version 0.1-7)

TermDocumentMatrix.DistributedCorpus: Term-Document Matrix from Distributed Corpora

Description

Constructs a term-document matrix given a distributed corpus.

Usage

## S3 method for class 'DistributedCorpus':
TermDocumentMatrix(x, control = list())

Arguments

x
A distributed corpus.
control
A named list of control options. The component weighting must be a weighting function capable of handling a TermDocumentMatrix. It defaults to weightTf for term frequency weighting. All other options are

Value

  • An object of class TermDocumentMatrix containing a sparse term-document matrix. The attribute Weighting contains the weighting applied to the matrix.

See Also

The documentation of termFreq gives an extensive list of possible options.

TermDocumentMatrix

Examples

Run this code
data("crude")
tdm <- TermDocumentMatrix(as.DistributedCorpus(crude),
control = list(weighting = weightTfIdf, stopwords = TRUE))
inspect(tdm[155:160,1:5])

Run the code above in your browser using DataLab