Possible Duplicate:
R: subset() logical-and operator for chaining conditions should be & not &&
What is the difference between short (&
,|
) and long (&&
, ||
) forms of AND, OR logical operators in R?
For example:
x==0 & y==1
x==0 && y==1
x==0 | y==1
x==0 || y==1
I always use the short forms in my code. Does it have any handicaps?