データの整形を練習しましょう
pivot_wider() は、データをすばやく整形(積み重ねや転置)して、mutate() を使いやすくしてくれる動詞です。
この演習はコースの一部です
Rで始めるテキスト分析
演習の手順
tidy_twitterを NRC 感情辞書に結合します。- 苦情ラベルと感情で集計します。
- 感情と件数の列を横持ちに広げます。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
tidy_twitter %>%
# Append the NRC sentiment dictionary
___(___) %>%
# Count by complaint label and sentiment
___(___) %>%
# Spread the sentiment and count columns
___(___, )