title: Is there a reason to prefer '&&' over '&' in 'if' statements, other than short-circuiting?
body: <p>Yes I know, there have been a number of questions (see <a href="https://stackoverflow.com/q/6558921/2207840">this one</a>, for example) regarding the usage of <code>&amp;</code> vs. <code>&amp;&amp;</code> in R, but I have not found one that specifically answers my question.</p>
  
  <p>As I understand the differences,</p>
  
  <ul>
  <li><code>&amp;</code> does element-wise, vectorised comparison, much like the other arithmetic operations. It hence returns a logical vector that has length > 1 if both arguments have length > 1.</li>
  <li><code>&amp;&amp;</code> compares the first elements of both vectors and always returns a result of length 1. Moreover, it does <em>short-circuiting</em>: <code>cond1 &amp;&amp; cond2 &amp;&amp; cond3 &amp;&amp; ...</code> only evaluates <code>cond2</code> if <code>cond1</code> is <code>TRUE</code>, and so forth. This allows for things like <code>if(exists("is.R") &amp;&amp; is.function(is.R) &amp;&amp; is.R())</code> and particularly means that using <code>&amp;&amp;</code> is strictly necessary in some cases.</li>
  </ul>
  
  <p>Moreover, <code>if</code> issues the warning</p>
  
  <blockquote>
    <p>the condition has length > 1 and only the first element will be used</p>
  </blockquote>
  
  <p>if its condition has more than one element.</p>
  
  <p><strong>Judging from these preliminaries, I'd consider it safer to prefer <code>&amp;</code> to <code>&amp;&amp;</code> in all <code>if</code> statements where short-circuiting isn't required.</strong></p>
  
  <p>If something went wrong during calculations and I accidentally have a vector in one of <code>&amp;</code>'s arguments, I get a warning, which is good. If not, everything is fine as well.</p>
  
  <p>If, on the other hand, I used <code>&amp;&amp;</code>, and something went wrong in my calculations and one of <code>&amp;&amp;</code>'s arguments is a vector, I don't get a warning. This is bad. If, for some reason, I really want to compare the first elements of two vectors, I'd argue that it's much cleaner to do so explicitly rather than implicitly.</p>
  
  <p>Note that this is contrary to what seems to be common agreement between R programmers and contrary to what the R docs recommend. (1)</p>
  
  <p><strong>Hence my question</strong>: Are there any reasons except short-circuiting that make <code>&amp;&amp;</code> preferable to <code>&amp;</code> in <code>if</code> statements?</p>
  
  <hr>
  
  <p>(1) Citing <code>help(&amp;&amp;)</code>:</p>
  
  <blockquote>
    <p>'&amp;' and '&amp;&amp;' indicate logical AND and '|' and '||' indicate
    logical OR.  The shorter form performs elementwise comparisons in
    much the same way as arithmetic operators.  The longer form
    evaluates left to right examining only the first element of each
    vector.  Evaluation proceeds only until the result is determined.
    The longer form is appropriate for programming control-flow and
    typically preferred in 'if' clauses.</p>
  </blockquote>