計算情緒次數
已為你載入 tidy_twitter 資料集。來看看在這些 Twitter 資料中,哪些情緒最常見。
本練習屬於課程
R 文字分析入門
練習說明
- 將
tidy_twitter與 NRC 情緒詞典做關聯。 - 在
sentiment_twitter中計算各情緒的次數。 - 依情緒次數由高到低排序。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Join tidy_twitter and the NRC sentiment dictionary
sentiment_twitter <- ___ %>%
___(___("nrc"))
# Count the sentiments in sentiment_twitter
___ %>%
___(___) %>%
# Arrange the sentiment counts in descending order
___(___)