Reduces the size of an image by binning the pixels.
Usage
binning(dataset, n.bin, fun = "mean")
Arguments
dataset
The dataset to be binned (in a matrix form)
n.bin
number of pixels to be binned (a natural number)
fun
if "mean", the value of the binned pixel is the average of the values of the initial pixels
if "sum", the value of the binned pixel is the sum of the values of the initial pixels