以下代码...
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))
产生
aCorpus
与 List of 2 - 它应该产生一个 VCorpus。至少,List of 2 显示在 RStudio 环境窗口中。
但是,
class(aCorpus)
在控制台中执行会生成正确的类。例如
> class(aCorpus)
[1] "VCorpus" "Corpus"
这是 tm 和 RStudio 之间的已知问题吗?