开始使用免费开始使用

练习数据重塑

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
  ___(___, )
编辑并运行代码