2

例如,这是一个 tdm:

str(AssociatedPress)
List of 6
$ i       : int [1:302031] 1 1 1 1 1 1 1 1 1 1 ...

$ j       : int [1:302031] 116 153 218 272 299 302 447 455 548 597 ...
$ v       : int [1:302031] 1 2 1 1 1 1 2 1 1 1 ...
$ nrow    : int 2246
$ ncol    : int 10473
$ dimnames:List of 2
..$ Docs : NULL
..$ Terms: chr [1:10473] "aaron" "abandon" "abandoned" "abandoning" ...
- attr(*, "Weighting")= chr [1:2] "term frequency" "tf"
- attr(*, "class")= chr [1:2] "DocumentTermMatrix" "simple_triplet_matrix"

我一直在试图找到这些列 $i、$j、$v 的描述......非常感谢,

4

1 回答 1

3

看看这个: http: //www.inside-r.org/packages/cran/slam/docs/as.simple_triplet_matrix

在下面?TermDocumentMatrix

我们看:

Value

An object of class TermDocumentMatrix or class DocumentTermMatrix
(both inheriting from a simple triplet matrix in package slam)
containing a sparse term-document matrix or document-term matrix. The
attribute Weighting contains the weighting applied to the matrix.

当您单击语句中的链接时,它们都继承自一个简单的三元组矩阵

Arguments

i, j    
Integer vectors of row and column indices, respectively.

v   
Vector of values.

和...

Details
simple_triplet_matrix is a generator for a class of
“lightweight” sparse matrices, “simply” represented by triplets (i,
j, v) of row indices i, column indices j, and values v, respectively.
simple_triplet_zero_matrix and simple_triplet_diag_matrix are
convenience functions for the creation of empty and diagonal
matrices.
于 2013-04-12T15:04:12.343 回答