[R] Boolean expression
drjimlemon at gmail.com
Mon Sep 14 13:19:02 CEST 2015
The character sequence "<-" is preferentially interpreted as "assign the
value on the right to the name on the left". You can use parentheses to
force the unary minus to be interpreted:
or you can just break the sequence with a space:
One less character, but perhaps easier to misread.
On Mon, Sep 14, 2015 at 9:10 PM, Jue Lin-Ye <jl.iccp at gmail.com> wrote:
> Dear fellow R users,
> I would like to discuss something. First of all, I would like to make clear
> that I think that the current R software is great.
> I have noticed that, for example, in the boolean expression "if(a<-1)", it
> is not clear if what is asked is "if 'a' is 1" or "if 'a' is lesser than
> -1". Should we just enclose "-1" within parentheses or should we have a
> more unequivocal syntax, here, like "a<$", "a<%"?
> Best regards,
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help