# Binning in 1D, 2D or 3D

### Description

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

### Usage

1 |

### Arguments

`x` |
design matrix, dimension n x d, |

`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. |

### Value

A list with components

`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` |
if |

`midpoints.x3` |
if |

`breaks.x1` |
Break points dimension 1 |

`breaks.x2` |
if |

`breaks.x3` |
if |

`table.freq` |
number of observations per bin |

`means` |
if |

`devs` |
if |

### Note

This function has been adapted from the code of function binning in package sm.

### Author(s)

Joerg Polzehl, polzehl@wias-berlin.de

### See Also

See Also as `aws.irreg`