Re: [R] Double AND within an IF statement

2016-02-24 Thread Bert Gunter
Yes! -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Feb 24, 2016 at 8:31 AM, Duncan Murdoch wrote: > On 24/02/2016 11:27 AM, Bert Gunter wrote:

Re: [R] Double AND within an IF statement

2016-02-24 Thread Duncan Murdoch
On 24/02/2016 11:27 AM, Bert Gunter wrote: I would have assumed that age, etc. were vectors; but that's why I said "almost" surely. Okay, so you were confusing if () with ifelse(). Duncan Murdoch -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along a

Re: [R] Double AND within an IF statement

2016-02-24 Thread Bert Gunter
I would have assumed that age, etc. were vectors; but that's why I said "almost" surely. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Feb 24,

Re: [R] Double AND within an IF statement

2016-02-24 Thread Duncan Murdoch
On 24/02/2016 11:18 AM, Bert Gunter wrote: Almost surely no. You are confusing "&&" with "&" ?"&" I think Bob had it right... Duncan Murdoch -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Bre

Re: [R] Double AND within an IF statement

2016-02-24 Thread Bert Gunter
Almost surely no. You are confusing "&&" with "&" ?"&" -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Feb 24, 2016 at 8:10 AM, Robert Sherry

Re: [R] Double AND within an IF statement

2016-02-24 Thread Robert Sherry
This should work: if ( age > 4 && age < 8 && infection > 0 ) replacement = 2 Bob On 2/24/2016 7:08 AM, Polychronis KOSTOULAS wrote: Hi there, apologies if this is easy. I want to write this condition: If age is more than 4 years and less or equal to 8 years and infection is positive the

Re: [R] Double AND within an IF statement

2016-02-24 Thread PIKAL Petr
ry 24, 2016 1:09 PM > To: r-help@r-project.org > Subject: [R] Double AND within an IF statement > > > Hi there, > > apologies if this is easy. I want to write this condition: > > If age is more than 4 years and less or equal to 8 years and infection > is posi

[R] Double AND within an IF statement

2016-02-24 Thread Polychronis KOSTOULAS
Hi there, apologies if this is easy. I want to write this condition: If age is more than 4 years and less or equal to 8 years and infection is positive then replacement is 2. Can you help me the double END? Thanks, Polychronis __ R-help@r-projec