Learn R Programming

aws (version 1.6-2)

binning: Binning in 1D, 2D or 3D

Description

The function performs a binning in 1D, 2D or 3D.

Usage

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

Arguments

x
design matrix, dimension n x d, 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.

Value

  • A list with components
  • xmatrix of coordinates of non-empty bin centers
  • x.freqnumber of observations in nonempty bins
  • midpoints.x1Bin centers in dimension 1
  • midpoints.x2if d>1 Bin centers in dimension 2
  • midpoints.x3if d>2 Bin centers in dimension 3
  • breaks.x1Break points dimension 1
  • breaks.x2if d>1 Break points dimension 2
  • breaks.x3if d>2 Break points dimension 3
  • table.freqnumber of observations per bin
  • meansif !is.null(y) mean of y in non-empty bins
  • devsif !is.null(y) standard deviations of y in non-empty bins

See Also

See Also as aws.irreg