0

我已经生成了termDocumentMatrix如下所示的:

> tmm
[[1]]
<<DocumentTermMatrix (documents: 18, terms: 4886)>>
Non-/sparse entries: 11956/75992
Sparsity           : 86%
Maximal term length: 25
Weighting          : term frequency (tf)

然后我想将它转换为数字矩阵,它显示一个错误。我使用的命令是:

matrix<-data.matrix(tmm)

然后矩阵变成这样的列表:

list(i = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,                                                                                       

我哪里做错了?

4

1 回答 1

0

你可以试试这个

matrix <- as.matrix(inspect(tmm))
于 2014-11-25T06:32:57.947 回答