title: Why does ifelse return a vector of 1 if strict inequality is used?
body: <p>I realized that my code is giving unanticipated results due to using <em>ifelse</em> with a strict inequality comparison:</p>
  
  <pre><code>library(tidyverse)
  
  df &lt;- tibble(a = seq(-10,10)) %&gt;%
    mutate( b = ifelse( (a&lt;-3) , 1, 0) ) %&gt;%
    mutate( c = ifelse( (a&lt;=-3) , 1, 0) )
  df
  </code></pre>
  
  <p>which gives</p>
  
  <pre><code>&gt; df
  # A tibble: 21 x 3
     a     b     c
   &lt;int&gt; &lt;dbl&gt; &lt;dbl&gt;
  1   -10     1     1
  2    -9     1     1
  3    -8     1     1
  4    -7     1     1
  5    -6     1     1
  6    -5     1     1
  7    -4     1     1
  8    -3     1     1
  9    -2     1     0
  10    -1     1     0
   ... with 11 more rows
  </code></pre>
  
  <p>b is a vector of ones, my understanding is that &lt;- is perceived as an assignment instead of a comparison but if that is the case I don't understand why the code is quietly evaluated instead of spitting out an error.</p>
  
  <p>Thanks for your help,</p>
  
  <p>J</p>