• Register
0 votes
927 views

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 5 3
6,930 points

Please log in or register to answer this question.

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))+
geom_bar()+
scale_x_discrete(breaks = 1:31)+
facet_wrap(~dob_month,ncol = 3)
9 7 4
38,600 points

Related questions

0 votes
1 answer 166 views
0 votes
1 answer 193 views
193 views
I am trying to run the rWBclimate package in RStudio. I copied the following code from ROpenSci and pasted it into RStudio. But I get an error saying 'I don't know how to automatically choose scale for list of type objects. Default error to continuous error: geom_point requires the following ... 50 50 50 50 50 50 ... $ locator: chr "GBR" "GBR" "GBR" "GBR" ... Looking for your helpful answers.
asked Aug 17, 2020 game 4.6k points
0 votes
1 answer 2.9K views
2.9K 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, 2020 mphil 2.3k points
0 votes
1 answer 1.1K views
1.1K 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
1 vote
1 answer 2.4K views
2.4K 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 94 views
0 votes
1 answer 72 views
0 votes
1 answer 65 views
65 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 89 views
89 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, 2020 jwilliam 3.9k points
0 votes
2 answers 21 views
21 views
Problem: Windows Disk Cleanup is the utility to use whenever you want to defragment your hard drive? True or False
asked Apr 6, 2020 ArifulIslam 5.6k points