
Last chance! 50% off unlimited learning
Sale ends in
TermDocumentMatrix(object, control = list())
DocumentTermMatrix(object, control = list())
weighting
must be a weighting function capable of handling a
TermDocumentMatrix
. It defaults to weightTf
for term
frequency weighting. All other options are TermDocumentMatrix
or class
DocumentTermMatrix
containing a sparse term-document matrix or
document-term matrix. The following slots contain useful information:termFreq
gives an extensive list of
possible options. Available weighting functions shipped with the weightTf
, weightTfIdf
, and
weightBin
.
data("crude")
tdm <- TermDocumentMatrix(crude, control = list(weighting = weightTfIdf, stopwords = TRUE))
dtm <- DocumentTermMatrix(crude, control = list(weighting = weightTfIdf, stopwords = TRUE))
inspect(tdm[165:170,1:5])
inspect(dtm[1:5,165:170])
Run the code above in your browser using DataLab