提问人:mnr 提问时间:2/24/2023 更新时间:2/24/2023 访问量:28
使用 R 的 tm 包,VectorSource 生成一个列表而不是语料库
With R's tm package, VectorSource produces a list instead of corpus
问:
以下代码...
library(tm)
vectorOfText <- c("twas brillig and the slithey toves",
"did gyre and gimble in the wabes")
names(vectorOfText) <- c("firstLine", "secondLine")
aCorpus <- VCorpus(VectorSource(vectorOfText))
使用 List of 2 的类生成 - 它应该生成一个 VCorpus。至少,RStudio 环境窗口中显示 List of 2。aCorpus
但是,在控制台中执行会生成正确的类。例如class(aCorpus)
> class(aCorpus)
[1] "VCorpus" "Corpus"
这是 tm 和 RStudio 之间的已知问题吗?
答: 暂无答案
评论