创建词云
我们已经看过条形图,现在来用词云可视化词频!tidy_twitter 已经加载、分词并清理完毕。
本练习是课程的一部分
R 文本分析入门
练习说明
- 加载
wordcloud包。 - 计算词频并赋值给
word_counts。 - 将
word_counts中的词列赋给words参数。 - 将
word_counts中的计数列(n)赋给freq参数。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Load the wordcloud package
___(___)
# Compute word counts and assign to word_counts
word_counts <- ___ %>%
___(___)
wordcloud(
# Assign the word column to words
___ = ___,
# Assign the count column to freq
___ = ___,
max.words = 30
)