2009/10/6 Uwe Ligges :
>
>
> Gabor Grothendieck wrote:
>>
>> 2009/10/6 Uwe Ligges :
>>>
>>> The first rule is easy: As long as you are using scalar valued (i.e.
>>> length
>>> 1 vectors in R) "cond", you should prefer
>>> if(cond) cons.expr else alt.expr
>>> rather than
>>> ifelse(cond, yes, no
Gabor Grothendieck wrote:
2009/10/6 Uwe Ligges :
The first rule is easy: As long as you are using scalar valued (i.e. length
1 vectors in R) "cond", you should prefer
if(cond) cons.expr else alt.expr
rather than
ifelse(cond, yes, no)
because the latter one evaluates both "yes" and "no" whi
2009/10/6 Uwe Ligges :
>
> The first rule is easy: As long as you are using scalar valued (i.e. length
> 1 vectors in R) "cond", you should prefer
> if(cond) cons.expr else alt.expr
> rather than
> ifelse(cond, yes, no)
> because the latter one evaluates both "yes" and "no" while the former one
David Winsemius wrote:
On Oct 5, 2009, at 5:38 AM, Martin Maechler wrote:
"DW" == David Winsemius
on Sat, 3 Oct 2009 12:56:51 -0400 writes:
DW> On Oct 3, 2009, at 11:54 AM, Chen Gu wrote:
Hello,
I am doing a simple if else statement in R. But it always comes out
error
such as 'un
On Oct 5, 2009, at 5:38 AM, Martin Maechler wrote:
"DW" == David Winsemius
on Sat, 3 Oct 2009 12:56:51 -0400 writes:
DW> On Oct 3, 2009, at 11:54 AM, Chen Gu wrote:
Hello,
I am doing a simple if else statement in R. But it always comes out
error
such as 'unexpected error'
There are
> "DW" == David Winsemius
> on Sat, 3 Oct 2009 12:56:51 -0400 writes:
DW> On Oct 3, 2009, at 11:54 AM, Chen Gu wrote:
>> Hello,
>>
>> I am doing a simple if else statement in R. But it always comes out
>> error
>> such as 'unexpected error'
>> There are
On 03/10/2009 11:54 AM, Chen Gu wrote:
Hello,
I am doing a simple if else statement in R. But it always comes out error
such as 'unexpected error'
There are two variables. ini and b. when ini=1, a=3; when ini>1 and b>2,
a=5; all other situations, a=6. I don't know where it is wrong.
Here is my c
On Oct 3, 2009, at 11:54 AM, Chen Gu wrote:
Hello,
I am doing a simple if else statement in R. But it always comes out
error
such as 'unexpected error'
There are two variables. ini and b. when ini=1, a=3; when ini>1 and
b>2,
a=5; all other situations, a=6. I don't know where it is wrong.
align the 'else if' and 'else' with the closing curly brackets.
if (condA){
doStuff()
} else if (condB){
doOtherStuff()
} else {
doWhatever()
}
b
On Oct 3, 2009, at 12:54 PM, Chen Gu wrote:
Hello,
I am doing a simple if else statement in R. But it always comes out
error
such as 'une
9 matches
Mail list logo