if true then any value in x above the last bin is assigned to that bin,
otherwise its bin is set to NA
by.value
if true then return average value for bin instead of bin numbers
Details
Replaces the values in a copy of the input data by the bin number it
belongs to, or by the bin average value with by.value. The lowest bin
always extends to -Inf. The extend.upper argument can open the last bin
to +Inf if true. Use this function to get in-place bin assignments for
the unsorted data that was passed to optbin.