開始使用免費開始

計算情緒次數

已為你載入 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
  ___(___)
編輯並執行程式碼