title: What is the difference between short (&,|) and long (&&, ||) forms of AND, OR logical operators in R?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6933598/r-subset-logical-and-operator-for-chaining-conditions-should-be-not">R: subset() logical-and operator for chaining conditions should be &amp; not &amp;&amp;</a>  </p>
  </blockquote>
  
  
  
  <p>What is the difference between short (<code>&amp;</code>,<code>|</code>) and long (<code>&amp;&amp;</code>, <code>||</code>) forms of AND, OR logical operators in R?</p>
  
  <p>For example: </p>
  
  <ol>
  <li><code>x==0 &amp; y==1</code></li>
  <li><code>x==0 &amp;&amp; y==1</code></li>
  <li><code>x==0 | y==1</code></li>
  <li><code>x==0 || y==1</code></li>
  </ol>
  
  <p>I always use the short forms in my code. Does it have any handicaps?</p>