Masukkan vektor numerik dan kembalikan kode bilangan bulat untuk binning.
.bincode(x, breaks, right = TRUE, include.lowest = FALSE)
| Parameter | Deskripsi |
|---|---|
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, indicating if the intervals should be closed on the right (and open on the left) or vice versa. |
include.lowest |
logical, 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. |
# NOT RUN {
## An example with non-unique breaks:
x <- c(0, 0.01, 0.5, 0.99, 1)
b <- c(0, 0, 1, 1)
.bincode(x, b, TRUE)
.bincode(x, b, FALSE)
.bincode(x, b, TRUE, TRUE)
.bincode(x, b, FALSE, TRUE)
# }