Learn R Programming

LOMAR (version 0.5.0)

binning: binning

Description

Binning in 1D, 2D or 3D.

Usage

binning(x, y, nbins, xrange = NULL)

Value

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)

Arguments

x

design matrix, dimension n x d with d in 1:3.

y

either a response vector of length n or NULL.

nbins

vector of length d containing number of bins for each dimension, may be set to NULL.

xrange

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.

Details

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.