【发布时间】:2021-08-21 17:41:56
【问题描述】:
我想制作一个由 autor 变量分组分隔的 wordcloud,我做到了:
# Create a dataframe that save freq of each word
tw <- tw_token %>% count(autor, word, sort=TRUE)
# head of data
dput(head(tw))
structure(list(autor = c("Mayoredlee", "Mayoredlee", "Elonmusk",
"Mayoredlee", "Mayoredlee", "Elonmusk"), word = c("sf", "city",
"tesla", "residents", "housing", "model"), n = c(775L, 320L,
263L, 260L, 180L, 163L)), row.names = c(NA, 6L), class = "data.frame")
# Make wordcloud
wordcloud(words = tw$word, freq = tw$n, min.freq = 1,
max.words=200, random.order=FALSE, rot.per=0.45,
colors=brewer.pal(8, "Dark2"))
【问题讨论】:
-
您能否提供带有
dput(head(DATA))的数据集样本,我们可以复制和粘贴以更好地了解问题和测试解决方案? (见How to make a great R reproducible example)...请告诉我们所需的输出是什么样的! -
感谢您的回答,我编辑了帖子
标签: r grouping subplot word-cloud