R ggplot - Error stat_bin requires continuous x variable

后端 未结 4 610
南方客
南方客 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:13

    I had the same issue but none of the above solutions worked. Then I noticed that the column of the data frame I wanted to use for the histogram wasn't numeric:

    df$variable<- as.numeric(as.character(df$variable))
    

    Taken from here

提交回复
热议问题