Why does the following code generate a Histogram of 7 cells instead of 5? Thanks for your help. --Tommy> data(islands) > str(hist(sqrt(islands), br = 5, col="lightblue", border="pink"))List of 7 $ breaks : num [1:8] 0 20 40 60 80 100 120 140 $ counts : int [1:7] 40 1 1 2 2 1 1 $ intensities: num [1:7] 0.04167 0.00104 0.00104 0.00208 0.00208 ... $ density : num [1:7] 0.04167 0.00104 0.00104 0.00208 0.00208 ... $ mids : num [1:7] 10 30 50 70 90 110 130 $ xname : chr "sqrt(islands)" $ equidist : logi TRUE - attr(*, "class")= chr "histogram" -- Tommy E. Cathey, Senior Scientific Application Consultant High Performance Computing & Scientific Visualization SAIC, Supporting the EPA Research Triangle Park, NC 919-541-1500 EMail: cathey.tommy at epa.gov My e-mail does not reflect the opinion of SAIC or the EPA. Federal Contact - John B. Smith 919-541-1087 - smith.johnb at epa.gov
?hist says breaks: one of: ... * a single number giving the number of cells for the histogram, ... In the last three cases the number is a suggestion only. On Fri, 27 Jun 2003, Tommy E. Cathey wrote:> Why does the following code generate a Histogram of 7 cells > instead of 5?> > data(islands) > > str(hist(sqrt(islands), br = 5, col="lightblue", border="pink")) > List of 7-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595