ワードクラウドを作成する
棒グラフは見てきましたね。次はワードクラウドで単語の出現回数を可視化してみましょう!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
)