powered by
Accessing document IDs, terms, and their number of a term-document matrix or document-term matrix.
Docs(x) nDocs(x) nTerms(x) Terms(x)
Either a TermDocumentMatrix or DocumentTermMatrix.
TermDocumentMatrix
DocumentTermMatrix
For Docs and Terms, a character vector with document IDs and terms, respectively.
Docs
Terms
For nDocs and nTerms, an integer with the number of document IDs and terms, respectively.
nDocs
nTerms
# NOT RUN { data("crude") tdm <- TermDocumentMatrix(crude)[1:10,1:20] Docs(tdm) nDocs(tdm) nTerms(tdm) Terms(tdm) # }
Run the code above in your browser using DataLab