首页 > 解决方案 > 使用库“ggplot2”创建一个可视化,显示出现至少 2000 次的标记的频率

问题描述

这是我当前在名为“q_content”的列上工作的代码。

*tidy_text %>% 
  count(q_content, sort = TRUE) %>% 
  filter(n > 2000) %>% 
  mutate(word = reorder(q_content, n)) %>% 
  ggplot(aes(q_content, n)) + 
  geom_bar(stat = "identity") + 
  xlab(NULL) + 
  coord_flip()*

我的错误:

*Error: Must group by variables found in `.data`.
* Column `q_content` is not found.
Run `rlang::last_error()` to see where the error occurred.*

标签: rggplot2textnlp

解决方案


推荐阅读