Binning in 1D, 2D or 3D.
binning(x, y, nbins, xrange = NULL)
a list with elements:
x matrix of coordinates of non-empty bin centers
x.freq number of observations in nonempty bins
midpoints.x1 bin centers in dimension 1
midpoints.x2 bin centers in dimension 2
midpoints.x3 bin centers in dimension 3
breaks.x1 break points dimension 1
breaks.x2 break points dimension 2
breaks.x3 break points dimension 3
table.freq number of observations per bin
means means of y in non-empty bins (if y isn't NULL)
devs standard deviations of y in non-empty bins (if y isn't NULL)
design matrix, dimension n x d with d in 1:3.
either a response vector of length n or NULL.
vector of length d containing number of bins for each dimension, may be set to NULL.
range for endpoints of bins for each dimension, either matrix of dimension 2 x d or NULL. xrange is increased if the cube defined does not contain all design points.
Copied from package aws which is no longer in CRAN. Original author: Joerg Polzehl (polzehl@wias-berlin.de) who adapted code of function binning in package sm.