[R] hist function to give each cell equal area

Peter Dalgaard p.dalgaard at biostat.ku.dk
Fri Jan 7 13:22:06 CET 2005


Dan Bolser <dmb at mrc-dunn.cam.ac.uk> writes:

> y <- table(cut(x,breaks=quantile(x,seq(0,1,length=nbin+1))))
> 
> > y
> [1] 399
> 
> I only get 399 counts out, and I put 400 counts in?

Look at the include.lowest argument. For some reason this is TRUE in
hist() but FALSE in cut().

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list