分词与计数
通过统计词频来探索 twitter_data 中航空公司推文的内容。每条推文的文本位于 tweet_text 列。
本练习是课程的一部分
R 文本分析入门
练习说明
- 加载 tidyverse 和 tidytext 包。
- 对
tweet_text列中的推文进行分词。 - 使用分词后的文本计算词频。
- 将计数结果按降序排列。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Load the tidyverse and tidytext packages
___(___)
___(___)
tidy_twitter <- twitter_data %>%
# Tokenize the twitter data
___(word, ___)
tidy_twitter %>%
# Compute word counts
___(___) %>%
# Arrange the counts in descending order
___(___)