简体   繁体   English

R文本挖掘中的Wordscloud

[英]Wordscloud in R text mining

When I am passing the given below arguments in R 当我在R中传递给定的下面的参数时

wordcloud(words[1:200], frequency[1:200], min.freq = 70)
wordcloud(words[1:200], frequency[1:200], max.words = 19)

It is showing this error: 它显示此错误:

Error in if (min.freq > max(freq)) min.freq <- 0 : missing value where TRUE/FALSE needed if(min.freq> max(freq))min.freq < - 0时出错:缺少值需要TRUE / FALSE

I am not able to find a solution. 我无法找到解决方案。

It's likely that frequency contains NA values; frequency可能包含NA值; remove them: 删除它们:

wordcloud(words[!is.na(frequency)], freqs[!is.na(frequency)])

It is because you probably have a NA in your frequency vector. 这是因为你的frequency向量中可能有一个NA I could replicate your problem with this: 我可以用这个复制你的问题:

wordcloud(c("test","test2","test20","test200","test2000"),freq=c(75,40,NA,100,10),min.freq=10) wordcloud(C( “测试”, “TEST2”, “test20”, “test200”, “test2000下”),FREQ = C(75,40,NA,100,10),min.freq = 10)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM