library("RTextTools", "topicmodels", "tm")
matrix <- create_matrix(data, language="english", removeNumbers=TRUE, stemWords = TRUE, weighting=weightTf)
> matrix
#DocumentTermMatrix (documents: 3104, terms: 7699)
#Non-/sparse entries: 28138/23869558
#Sparsity : 100%
#Maximal term length: 19
#Weighting : term frequency (tf)
这是作为输出提供的元数据。我想知道的是,是否有任何命令可以实际查看词干或观察非稀疏条目。通过使用 nrow(matrix) 和 ncol(matrix),我了解了矩阵的大小,但我需要更多帮助来解构矩阵。我正在使用 NYTimes 数据集。