【发布时间】:2016-02-25 05:13:15
【问题描述】:
我正在使用tm 包来计算数据集的术语文档矩阵,我现在必须将术语文档矩阵写入文件,但是当我在 R 中使用写入函数时出现错误。
这是我正在使用的代码和我得到的错误:
data("crude")
tdm <- TermDocumentMatrix(crude, control = list(weighting = weightTfIdf, stopwords = TRUE))
dtm <- DocumentTermMatrix(crude, control = list(weighting = weightTfIdf, stopwords = TRUE))
这是我在此数据上使用 write.table 命令时出现的错误:
Error in cat(list(...), file, sep, fill, labels, append) : argument 1 (type 'list') cannot be handled by 'cat'
我知道 tbm 是 Simple Triplet Matrix 类型的对象,但我怎样才能将它写入一个简单的文本文件。
【问题讨论】:
标签: r