開始使用免費開始

加入自訂停用詞

你在 twitter_data 中看到一些沒有資訊性的字詞,應該從最後的詞彙清單中移除。在這個練習中,你會把幾個詞加入 custom_stop_words 資料框。

本練習屬於課程

R 文字分析入門

檢視課程

練習說明

  • 新的自訂停用詞資料框之欄位名稱應與 stop_words 相同。
  • httpwint.co 加為自訂停用詞。
  • 將自訂停用詞與 stop_words 進行列結合(row bind)。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

custom_stop_words <- tribble(
  # Column names should match stop_words
  ___, ___,
  # Add http, win, and t.co as custom stop words
  ___, "CUSTOM",
  ___, "CUSTOM",
  ___, "CUSTOM"
)

# Bind the custom stop words to stop_words
stop_words2 <- stop_words %>% 
  ___(___)
編輯並執行程式碼