If eq(g1, 1) it's a conditional for TRUE or FALSE of g1 = 1 How is the conditional for g1 != 1, I mean g1 NOT EQUAL to 1 in this case?
May be the answer is just ifelse(eq(eq(g1, 1) , 1), 0, 1) But I think must be a better answer...
Hi,
the answer is to use an "ifelse" statement, but you can simplify it to
ifelse(eq(g1,1), 0, 1)
if you want get get "0" as result if "g1 == 1" and "1" for "g1 != 1".
Best regards, Volker
Hi Volker!
Thanks!!
Log in to post a comment.
If eq(g1, 1) it's a conditional for TRUE or FALSE of g1 = 1
How is the conditional for g1 != 1, I mean g1 NOT EQUAL to 1 in this case?
May be the answer is just ifelse(eq(eq(g1, 1) , 1), 0, 1)
But I think must be a better answer...
Hi,
the answer is to use an "ifelse" statement, but you can simplify it to
if you want get get "0" as result if "g1 == 1" and "1" for "g1 != 1".
Best regards,
Volker
Hi Volker!
Thanks!!