1

I have simple histogram, but can't adjust the binwidth:

qplot(factor(size_class),data=mydf,geom="histogram",binwidth = 0.01) 

size_class is a categorical variable (char) that groups mydf into groups according to another size variable. All I want to get is a graph like:

plot(table(mydf$size_class)

using ggplot2. The code above does work but binwidth is ignored somehow. I feel it has something to do with my group variable, since examples with numeric variables worked. How can I get it done with this kind of variable?

thx in advance for any help…

1 Answer 1

2

You can't set the binwidth for a categorical variable - it doesn't mean anything because there isn't an underlying continuous scale.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.