[R] Bug in ifelse

2008-10-09 Thread Daniel Malter
Hi all, I am quite sure it's not a bug, but I am going nuts about this. I do not possibly understand why I get different results for b1 and b2 as shown below. x=c(183,191,192,193,195,206,207,209,210,211,212,213,214,217,218,221,222,223, 224,225,227,228,229,230) y=c(221,225,228,241,242)

Re: [R] Bug in ifelse

2008-10-09 Thread Rolf Turner
On 10/10/2008, at 10:33 AM, Daniel Malter wrote: Hi all, I am quite sure it's not a bug, but I am going nuts about this. I do not possibly understand why I get different results for b1 and b2 as shown below. x=c (183,191,192,193,195,206,207,209,210,211,212,213,214,217,218,221,222,2 23,

Re: [R] Bug in ifelse

2008-10-09 Thread Daniel Malter
I just gave up a second too early: It does not work with ifelse(...) as ifelse(...) assigns only a singley value (the first in the vector). A regular if(...) else ... condition works, however. Daniel Malter wrote: Hi all, I am quite sure it's not a bug, but I am going nuts about this. I do