Re: [R] findInterval() surprising behavior

2016-10-20 Thread Rui Barradas
Thanks. It really seemed to be a bug. Rui Barradas Em 20-10-2016 11:33, Peter Dalgaard escreveu: It's a bug (left.open=FALSE code gets executed in some cases). Hoping to have a fix tested and in place before 3.3.2. -pd On 17 Oct 2016, at 21:48 , Rui Barradas wrote: Hello, Same on Windows

Re: [R] findInterval() surprising behavior

2016-10-20 Thread Peter Dalgaard
It's a bug (left.open=FALSE code gets executed in some cases). Hoping to have a fix tested and in place before 3.3.2. -pd > On 17 Oct 2016, at 21:48 , Rui Barradas wrote: > > Hello, > > Same on Windows 7. > > > findInterval(x=c(6, 1, 1, 1), vec=c(0, 1, 3, 5, 10), left.open=TRUE) > [1] 4 2 1

Re: [R] findInterval() surprising behavior

2016-10-17 Thread Rui Barradas
Hello, Same on Windows 7. > findInterval(x=c(6, 1, 1, 1), vec=c(0, 1, 3, 5, 10), left.open=TRUE) [1] 4 2 1 1 > findInterval(x=c(4, 1, 1, 1), vec=c(0, 1, 3, 5, 10), left.open=TRUE) [1] 3 1 1 1 > sessionInfo() R version 3.3.1 (2016-06-21) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Wi

[R] findInterval() surprising behavior

2016-10-17 Thread Dmitriy Chernykh via R-help
Hello, I call function findInterval in the following way: findInterval(x=c(6, 1, 1, 1), vec=c(0, 1, 3, 5, 10), left.open=TRUE), and expect that it will return 4 1 1 1. But the function returns 4 2 1 1 instead. Moreover, if I change the first element in x to, say, 4 - findInterval(x=c(4, 1, 1,