No.
Think of "if" only as a means to control program flow.
Use ifelse to use conditional logic on each item of a vector
Best wishes,
Mark
On 21/10/2007, stat stat <[EMAIL PROTECTED]> wrote:
> Dear Mark,
>
> Thanks for this. Can you please explain me what is the difference between
> ifelse and
Dear Mark,
Thanks for this. Can you please explain me what is the difference between
ifelse and if?
generally if there is more than one syntax within the 'if' I use 'if' loop
otherwise I use 'ifelse' loop. Is it the only difference between them?
Mark Wardle <[EMAIL PROTECTED]> wrote: On 21/10/
On 21/10/2007, stat stat <[EMAIL PROTECTED]> wrote:
> I have created a if loop as follows:
>
> name = "e"
> if (name == "v")
> {
>u = 0
> }
> else u = 1
>
> however i am getting error : Error: unexpected 'else' in "else"
There are 3 issues here:
1. Do you appreciate the difference between i
I have created a if loop as follows:
name = "e"
if (name == "v")
{
u = 0
}
else u = 1
however i am getting error : Error: unexpected 'else' in "else"
definitely I can write in : ifelse() form, however I want to write in this
way. Can anyone tell me where is my error?
thanks in advance
4 matches
Mail list logo