It seems that for large N
(say 2e6
) the cut2
function in the Hmisc
package throws an error
y = cut2(rnorm(2000000,0,1),m=sqrt(2000000))
Error in if (cj == upper) next : missing value where TRUE/FALSE needed
In addition: Warning message:
In (1:g) * nnm : NAs produced by integer overflow
I'm trying to obtain quantiles of my data, with m
points in each quantile, and also record endpoints of each quantile. cut2
does this, but not very well for large N
. Are there better alternatives?