为什么会有这样的报错,搞不懂啥意思
代码有那里错了吗
#绘制词云图
library(wordcloud2)
#统计正面评论词频
posFrep <- table(posdata$word)
posFrep <- sort(posFrep,decreasing = TRUE)
posFrep <- data.frame(posFrep)
head(posFrep)
wordcloud2(posFrep[3:100,],color = 'random-dark')
#统计负面评论词频
negFrep <- table(negdata$word)
negFrep <- sort(negFrep,decreasing = TRUE)
negFrep <- data.frame(negFrep)
head(negFrep)
wordcloud2(negFrep[7:77,],color = 'random-dark')
之前同样的代码可以成功的
library(wordcloud2)
#词频统计
word.frep <- table(result_n$word)
word.frep <- sort(word.frep,decreasing = TRUE)
word.frep <- data.frame(word.frep)
wordcloud2(word.frep[1:400,],size=0.5,shape='cardioid',backgroundColor='pink',color = "random-dark")