练习数据重塑
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
___(___, )