[R] dividing vectors into bins with equal widths

W. Daniel Kissling kissling at uni-mainz.de
Tue Nov 14 13:52:28 CET 2006


Hi R-users,

I am trying to divide a vector (say X) into equal frequency bins. If one uses the hist() 
function, then a histogram is plotted, but with bins of equal widths, and not with bins 
having the same number of data points.

I have then tried the histogram() function as follows:

histogram(X, nint=10, breaks=NULL, equal.widths=F)

This works as I want. However, I can't extract which points are in which bin, or where 
the breakpoints are made.

Can anybody help?

Thanks 
Daniel

--------------------------------------------------------------------
W. Daniel Kissling
Institut für Zoologie, Abteilung Ökologie
Johannes Gutenberg-Universität Mainz
D-55099 Mainz, Germany
E-mail: kissling at uni-mainz.de



More information about the R-help mailing list