Display frequency instead of count with geom_bar() in ggplot

前端 未结 2 1279
别跟我提以往
别跟我提以往 2020-12-10 10:33

On this page, they give the following example

library(ggplot2)
library(reshape2)
ggplot(data=tips, aes(x=day)) + geom_bar(stat=\"bin\")

Ins

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-10 11:17

    now ..prop.. is available

    ggplot(data=tips, aes(x=day)) + 
      geom_bar(aes(y = ..prop.., group = 1))
    

提交回复
热议问题