title: Why does only `case_when` give different results in R?
body: <p>I noticed this behavior below when
  I used <code>dplyr::case_when</code> instead of <code>if</code> in reference to <a href="https://stackoverflow.com/questions/25640161/r-how-to-test-for-character0-in-if-statement">this article</a>.
  If the output of the second branch is an explicit string, it works as intended, but if the <code>x</code> itself is specified, the result changes.</p>
  <p>Why does only <code>case_when</code> give different results?</p>
  <pre class="lang-r prettyprint-override"><code>x &lt;- character(0)
  
  dplyr::case_when(rlang::is_empty(x) ~ &quot;Empty&quot;, !rlang::is_empty(x) ~ &quot;Not empty&quot;)
  #&gt; [1] &quot;Empty&quot;
  dplyr::case_when(rlang::is_empty(x) ~ &quot;Empty&quot;, !rlang::is_empty(x) ~ x)
  #&gt; character(0)
  
  if (rlang::is_empty(x)) &quot;Empty&quot; else if (!rlang::is_empty(x)) &quot;Not empty&quot;
  #&gt; [1] &quot;Empty&quot;
  if (rlang::is_empty(x)) &quot;Empty&quot; else if (!rlang::is_empty(x)) x
  #&gt; [1] &quot;Empty&quot;
  
  ifelse(rlang::is_empty(x), &quot;Empty&quot;, &quot;Not empty&quot;)
  #&gt; [1] &quot;Empty&quot;
  ifelse(rlang::is_empty(x), &quot;Empty&quot;, x)
  #&gt; [1] &quot;Empty&quot;
  </code></pre>
  <p><sup>Created on 2022-08-16 by the <a href="https://reprex.tidyverse.org" rel="noreferrer">reprex package</a> (v2.0.1)</sup></p>