histogram - R hist right/left clump binning -


i have data set of length 15,000 real values 0 100. data set heavily skewed left. i'm trying accomplish following bins: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, >10. have done far created following:

  breakvector = c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100)  

and have run:

  hist(datavector, breaks=breakvector, xlim=(0, 13)) 

however, seems results in histogram data greater 13 aren't included. have idea on how r bin rest of data in last bin. in advance.

how this

datavector<-c(sample(1:9, 40, replace=t), sample(10:100, 20, replace=t)) breakvector <- c(0:11) hist(ifelse(datavector>10,11,datavector), breaks=breakvector, xlim=c(0, 13), xaxt="n") axis(1, at=1:11-.5, labels=c(1:10, ">10")) 

rather adjusting breaks, throw values >10 bin 11. update axis accordingly.

enter image description here


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -