I cant correctly control if a bin is going from e.g. -10 to +10 or from 0 to 20 when I say binwidth = 20
i get the former but I have data that begins at 1 and I dont want the interval to go into the negatives.
Here is an example of my problem:
testData = data.frame(x=c(1,4,6,9,9))
ggplot(data=testData, aes(x=testData$x)) +
geom_histogram(binwidth=3, aes(col=I("white"))) +
scale_x_continuous(breaks=c(1,2,3,4,5,6,7,8,9,10))
strange enough, if I use binwidth = 2
I end up with intervals like I want:
ggplot(data=testData, aes(x=testData$x)) +
geom_histogram(binwidth=2, aes(col=I("white"))) +
scale_x_continuous(breaks=c(1,2,3,4,5,6,7,8,9,10))
How can I get my bins to go from 1..20, 21..40, etc. for a larger dataset?