Skip to content
Prev 2147 / 10988 Next

[Rcpp-devel] [R] Find number of elements less than some number: Elegant/fastsolution needed

On Thu, Apr 14, 2011 at 8:19 PM, Ravi Varadhan <rvaradhan at jhmi.edu> wrote:
Have you looked at the definition of the findInterval function,
especially the part where it calls the C function?

I still think that it can be done faster if the x vector is sorted in
addition to the y vector, although admittedly the speed gain will not
be as much.  And, of course, Bill's solution depends on knowing R or
S-PLUS well enough to remember that there is a findInterval function.
Message-ID: <BANLkTimBaZ4bE=kTeY9neVwhjiJgHmjZ6g@mail.gmail.com>
In-Reply-To: <79F23BA7BB084E4FA01A8B93904CD02CF65FCAC2B7@WIGGUMVS.win.ad.jhu.edu>