【问题标题】:I can't create a cloud with this algoritm我无法使用此算法创建云
【发布时间】:2020-12-11 22:44:36
【问题描述】:

我正在尝试运行此代码来创建我在课堂上看到的 wordcloud。但是我无法通过尝试绘制 wordcloud 时出现的错误找到解决问题。错误是: wordcloud 中的错误(dfCorpus,max.words = 100,random.order = FALSE): 无法找到“wordcloud”功能。有人可以帮忙吗?

install.packages("tm", "SnowballC", "worldcloud", "RColorBrewer")
library(tm, SnowballC,worldcloud,RColorBrewer)

df <- read.csv('C:/r_fundamentos/parte2/questoes.csv', sep = ",")
head(df)

dfCorpus <-Corpus(VectorSource(df$Question))
class(dfCorpus)
dfCorpus <- tm_map(dfCorpus, PlainTextDocument)
dfCorpus <- tm_map(dfCorpus,removePunctuation)
dfCorpus <- tm_map(dfCorpus, removeWords, stopwords("english"))
dfCorpus <- tm_map(dfCorpus, stemDocument)
dfCorpus <- tm_map(dfCorpus, removeWords, c("the", "this", c(stopwords("english"))))
wordcloud(dfCorpus, max.words = 100, random.order = FALSE)

【问题讨论】:

  • “wordcloud”的拼写错误。

标签: r data-science word-cloud


【解决方案1】:

我认为他没有加载所有的包。试试吧:

图书馆(tm);图书馆(雪球C);图书馆(世界云);库(RColorBrewer)

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-04-22
相关资源
最近更新 更多