quantize: Quantizes real values to integer levels.
Description
This function quantizes real values in the interval [a, b] to integer levels from 0 to k-1.
Usage
quantize(arr, a, b, k = 10)
Value
A vector of quantized integers in 0, ..., k - 1.
Arguments
- arr
A numeric vector in the interval [a, b].
- a
The lower bound of the interval.
- b
The upper bound of the interval.
- k
The number of quantization levels (default is 10).