Skip to content
Prev 170149 / 398506 Next

bar plot/ histogram

You can still use hist, just provide your own breaks:

mydata <- sample(1:10, 100, TRUE, 10:1)
br <- c( 0.5:4.5, 10.5 )
hist(mydata, breaks=br, xaxt='n')
axis(1, at= c(1:4, mean(5:10)), c( 1:4, '5-10'))
box(bty='l')

hope this helps,