• Register
0 votes
1.2k 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 73 views
73 views
Problem: ggplot error: discrete value supplied to continuous scale.
asked Feb 23 Dan phillip 4.8k points
0 votes
1 answer 373 views
0 votes
1 answer 43 views
43 views
Problem : position_dodge requires non-overlapping x intervals
asked Feb 23 Shovo210 14k points
0 votes
1 answer 8 views
8 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 Mar 14 Wafa Abu Yousef 6.1k points
0 votes
1 answer 1.5K views
1.5K 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 471 views
471 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 37 views
37 views
Problem: Why I got the error: Error in is.finite(x) : default method not implemented for type 'list'.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 3.7K views
3.7K 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 202 views
0 votes
1 answer 313 views