number {tm}R Documentation

The Number of Rows/Columns/Dimensions/Documents/Terms of a Term-Document Matrix

Description

Return the number of rows, columns, dimensions, documents, and terms of a term-document matrix or a document-term matrix.

Arguments

x Either a term-document matrix or a document-term matrix.

Examples

data("crude")
tdm <- TermDocumentMatrix(crude)[1:10,1:20]
ncol(tdm)
nrow(tdm)
dim(tdm)
nDocs(tdm)
nTerms(tdm)

[Package tm version 0.3-4.1 Index]