range package:statistics

O(n) Range. The difference between the largest and smallest elements of a sample.
O(n) Compute decent defaults for the lower and upper bounds of a histogram, based on the desired number of bins and the range of the sample data. The upper and lower bounds used are (lo-d, hi+d), where
d = (maximum sample - minimum sample) / ((bins - 1) * 2)
If all elements in the sample are the same and equal to x range is set to (x - |x|10, x + |x|10). And if x is equal to 0 range is set to (-1,1). This is needed to avoid creating histogram with zero bin size.
a, the lower bound of the support {a, ..., b}
b, the upper bound of the support {a, ..., b}