title: using dplyr case_when to alter NA values based on value from another column
body: <pre><code>structure(list(a = c(NA, 3, 4, NA, 3, "Council" , "Council", 1), b = c("Council A", 3, 4, 
  "Council B", 6, 7, 2, 6), c = c(6, 3, 6, 5, 3, 6, 5, 3), d = c(6, 2, 4, 
  5, 3, 7, 2, 6), e = c(1, 2, 4, 5, 6, 7, 6, 3), f = c(2, 3, 4, 
  2, 2, 7, 5, 2)), .Names = c("a", "b", "c", "d", "e", "f"), row.names = c(NA, 
  8L), class = "data.frame")
  </code></pre>
  
  <p>I am trying to convert objects in <code>a</code> using dplyr mutuate and case_when based on text in <code>b</code> . I want to convert values in <code>a</code> to Council if <code>b</code> contains Council in the string. </p>
  
  <p>The code i've used is <code>DF %&gt;% select(a, b) %&gt;% mutate(a =case_when(grepl("Council", b) ~"Council"))</code></p>
  
  <p>However all values become <code>NA</code> in a if they do not contain the string Council. I've reviewed other posts and attempted various methods including <code>ifelse</code>. I want to maintain the same dataframe just make any <code>NA</code> values in a be converted to Council but only in the cases where it is <code>NA</code> values.</p>