• Register
0 votes

Problem :

While drawing graphs using ggplot2 getting bellow error
statbin requires a continuous x variable the x variable is discrete. perhaps you want stat="count"?
6.9k points

1 Answer

0 votes

Solution :

I had the same issue in the past to resolve my issue i followed bellow instructions

Please use geom_bar() instead of geom_histogram, Also please refer sample code given bellow it provides separate graph for each month for birth date data:

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

Related questions

0 votes
1 answer 277 views
Problem : I need answer to bellow issue don't know how to automatically pick scale for object of type data.frame. defaulting to continuous.
asked Nov 7, 2019 peterlaw 6.9k points
0 votes
1 answer 1.4K views
Problem : Currently I am trying to create a heatmap using a ggmosaic, But I keep facing below error “Error in is.finite(x) : default method not implemented for type 'list'” My Configuration is Windows, RStudio, R version mostly one before a most recent, and ggmosaic Ver 0.1.2 How can I fix the above error?
asked Feb 20 mphil 2.3k points
1 vote
1 answer 1.2K views
Problem : I am facing error related to ggproto as following error: cannot add ggproto objects together. did you forget to add this object to a ggplot object?
asked Nov 11, 2019 peterlaw 6.9k points
0 votes
1 answer 27 views
Problem : How can the following error message be solved? a footer of section 1 is set outside the printable area of the page. do you want to continue?
asked Nov 15, 2019 peterlaw 6.9k points
0 votes
2 answers 54 views
Problem : I want to compile a project in Eclipse using the m2eclipse. I set my JDK path in Eclipse as below: Windows-->preferences-->installed jres--> jdk1.7.xx path But this is showing me below error [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ ... BUILD FAILURE [INFO] ------------------------------------------------------------------------
asked Feb 4 jwilliam 3.9k points