title: How to incorporate NULL values into case_when?
body: <p>I am working with the following data set.</p>
  <pre><code>Name   X      Y 
  Mike   3.2    3.1
  Joe    4.5    1.7
  Eric   6.2    2.2
  Stan   NA     4.8
  </code></pre>
  <p>I am making a new column that creates a new column using <code>mutate</code> and <code>case_when</code>. The value in the new column is the midpoint between X and y if X is greater than 5, or 3/4 of the distance between X and Y if X is less than or equal to 5, or 20 if the value of x is null. I've tried some code along these lines but haven't had any luck.</p>
  <pre><code>df &lt;- df %&gt;%
      mutate(NewCol = case_when(X &gt;5 ~ (X+Y)/2,
                                X &lt;= 5 ~ ((X+Y)*3)/4,
                                X = &quot;NA&quot; ~ 20)
  </code></pre>
  <p>This is what I ultimately want to end up with:</p>
  <pre><code>Name   X      Y       NewCol
  Mike   3.2    3.1     2.475
  Joe    4.5    1.7     4.65
  Eric   6.2    2.2     4.2
  Stan   NA     4.8     20
  </code></pre>