R ggplot - Error stat_bin requires continuous x variable

后端 未结 4 571
南方客
南方客 2020-12-28 18:50

My table is data.combined with following structure:

\'data.frame\':   1309 obs. of  12 variables:
 $ Survived: Factor w/ 3 levels \"0\",\"1\",\"None\": 1 2 2         


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-28 19:23

    As stated above use geom_bar() instead of geom_histogram, refer sample code given below(I wanted separate graph for each month for birth date data):

    ggplot(data = pf,aes(x=dob_day))+
    geom_bar()+
    scale_x_discrete(breaks = 1:31)+
    facet_wrap(~dob_month,ncol = 3)
    

提交回复
热议问题