[英]R - ggplot2 geom_bar() doesn't plot correctly column's values
I am new to R
我是
R
新手
I would like plot using ggplot2
's geom_bar()
: 我想使用
ggplot2
的geom_bar()
进行ggplot2
:
top_r_cuisine <- r_cuisine %>%
group_by(Rcuisine) %>%
summarise(count = n()) %>%
arrange(desc(count)) %>%
top_n(10)
But when I try to plot this result by:
但是当我尝试通过以下方式绘制此结果时:
ggplot(top_r_cuisine, aes(x = Rcuisine)) +
geom_bar()
I get this: 我得到这个:
which doesn't represent the values in
top_r_cuisine
. 这不代表
top_r_cuisine
的值。 Why? 为什么?
EDIT: I have tried: 编辑:我尝试过:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.