.bincode() function in R Language is used to bin a numeric vector and return integer codes for the binning.
.bincode(x, breaks, right = TRUE, include.lowest = FALSE)
x: a numeric vector which is to be converted to integer codes by binning.
breaks: a numeric vector of two or more cut points, sorted in increasing order.
right: logical value, indicating if the intervals should be closed on the right (and open on the left) or vice versa.
include.lowest: logical value, indicating if an ‘x[i]’ equal to the lowest (or highest, for right = FALSE) ‘breaks’ value should be included in the first (or last) bin.
 NA 1 1 1 1  NA 1 1 1 1  1 1 1 1 2
 1 1 1 1 1  1 1 1 1 2
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.