R ggplot2: stat_count() must not be used with a y aesthetic error in Bar graph

前端 未结 4 1348
[愿得一人]
[愿得一人] 2020-12-02 06:34

I am getting this error while plotting a bar graph and I am not able to get rid of it, I have tried both qplot and ggplot but still the same error.

Following is my c

4条回答
  •  自闭症患者
    2020-12-02 07:12

    You can use geom_col() directly. See the differences between geom_bar() and geom_col() in this link https://ggplot2.tidyverse.org/reference/geom_bar.html

    geom_bar() makes the height of the bar proportional to the number of cases in each group If you want the heights of the bars to represent values in the data, use geom_col() instead.

    ggplot(data_country)+aes(x=country,y = conversion_rate)+geom_col()
    

提交回复
热议问题