【发布时间】:2014-11-25 15:27:14
【问题描述】:
我想使用 Wordcloud 功能对 Twitter 数据进行云计算。我已经安装了 twitter 包并使用了 api。之后我会执行以下操作。
bigdata <- searchTwitter("#bigdata", n=20)
bigdata_list <- sapply(bigdata, function(x) x$getText())
bigdata_corpus <- Corpus(VectorSource(bigdata_list))
bigdata_corpus <- tm_map(bigdata_corpus, content_transformer(tolower), lazy=TRUE)
bigdata_corpus <- tm_map(bigdata_corpus, removePunctuation, lazy=TRUE)
bigdata_corpus <- tm_map(bigdata_corpus,
function(x)removeWords(x,stopwords()), lazy=TRUE)
wordcloud(bigdata_corpus)
这会产生 Wordcloud 命令的错误消息:
Error in UseMethod("meta", x) :
no applicable method for 'meta' applied to an object of class "try-error"
In addition: Warning messages:
1: In mclapply(x$content[i], function(d) tm_reduce(d, x$lazy$maps)) :
all scheduled cores encountered errors in user code
2: In mclapply(unname(content(x)), termFreq, control) :
all scheduled cores encountered errors in user code
我尝试了不同的语料库命令,但似乎无法正确执行。 有什么想法吗?
【问题讨论】: