title: logical to factors (or strings) in data.frame
body: <p>How can recode logical to factors  (or strings) in data.frame?</p>
  
  <pre><code>data &lt;- data.frame(year = c(2015, 2015, 2016, 2016),
                 column2 = c(4, NA, 9, 1))
  
  
  library (dplyr)
  
  missing_data &lt;- data %&gt;%
                count(year, complete.cases(column2)) 
  
  names(missing_data)[2] = "col2" 
  </code></pre>
  
  <p>My results:</p>
  
  <pre><code>year  col2     n
  (dbl) (lgl) (int)
  2015 FALSE     1
  2015  TRUE     1
  2016  TRUE     2 
  </code></pre>
  
  <p>What I want:</p>
  
  <pre><code>year  col2      n
  (dbl)        (int)
  2015  unknown    1
  2015  known      1
  2016  known      2 
  </code></pre>
  
  <p>What I tried (in dplyr chain):</p>
  
  <pre><code>mutate(col2 = as.factor(col2))
  </code></pre>