Displaying 1 result from an estimated 1 matches for "s_binning3".
2002 Mar 28
0
Summary: Vectorizing closest match
...0, x[-n]+diff(x)/2,1e30)
m <- length(w)
if(.R.) i[.C("bincode", as.double(w), m, as.double(br),
length(br), code = integer(m), right = TRUE,
include = FALSE, NAOK = TRUE, DUP = FALSE,
PACKAGE = "base")$code] else
i[.C("S_binning3", x=as.double(w), m, as.double(br),
length(br), 0, 0, TRUE, TRUE)$x] # For S-Plus
}
Note that for large n, cut.default is extremely slow.
Thomas Lumley had a nice approach using a new function findInterval. All three approaches are extremely fast. The main difference between approx...