以下代码生成一个简单的比较云:
library(tm)
library(wordcloud)
text1<- "cat cat dog dog dog bird bird bird bird bike bike bike"
text2<- "cat cat dog dog dog dog fish fish fish fish car car"
tmpText <- data.frame(c(text1, text2))
row.names(tmpText)<- c("text1", "text2")
ds <- DataframeSource(tmpText)
corp <- Corpus(ds)
corp <- tm_map(corp, PlainTextDocument)
corp <- tm_map(corp, content_transformer(tolower))
corp<- tm_map(corp, removePunctuation)
tm <- TermDocumentMatrix(corp)
tm<- as.matrix(tm)
colnames(tm) <- c("text1", "text2")
comparison.cloud(tm, , scale=c(5, 1))
我有两个问题:
1-如果两个单词在多个文档中具有相同的频率,包如何决定将其显示在一个子云中 VS 其他
2-根据文档:“每个单词......它的角度位置由出现最大值的文档确定。” 我在没有种子的情况下多次运行比较云,我无法理解解释,我用谷歌搜索解释,没有找到太多,“角度位置”在这种情况下是什么意思?
非常感谢帮助
乔丹