Skip to content

hist - unevenly spaced bars

2 messages · Worik R, Peter Ehlers

#
Well, your bars are not unevenly spaced; you just have
some zero-count intervals. Time to learn about the
str() function which will tell you what's going on.

zh <- hist(your_code)
str(zh)
zh$breaks
zh$counts

You could set breaks with

hist(..., breaks=0:5 + .5)

But a histogram doesn't seem like the right thing to do.
Try barplot:

barplot(table(Q5))

  -Peter Ehlers
Worik R wrote: