R hist(): how to set proper bins -


i'm trying obtain hist plot on set of numeric data, getting "some 'x' not counted; maybe 'breaks' not span range of 'x' " error.

my data range is:

> range(width(myseq2)) [1] 350 16739

and command is:

hist(width(myseq2), breaks=c(350, seq(500, 16800, 150)), col="blue", ylim = c(0,40000))

meaning want bins of 150, spanning minimal maximal values of data.

i don't what's wrong.. explanations.

the range gets truncated @ top end because doesn't divide evenly. 16739 value doesn't bin.

range(c(350, seq(500, 16800, 150)))   # [1]   350 16700 

just expand range, example:

hist(width(myseq2), breaks=c(350, seq(500, 16850, 150)), col="blue", ylim = c(0,40000)) 

Comments