title: separate() in tidyr with NA
body: <p>I have a question related to <code>separate()</code> in the <a href="/questions/tagged/tidyr" class="post-tag" title="show questions tagged &#39;tidyr&#39;" rel="tag">tidyr</a> package. When there is no NA in a data frame, separate() works. I have been using this function a lot. But, today I had a case in which there were NAs in a data frame. <code>separate()</code> returned an error message. I could be very silly. But, I wonder if <a href="/questions/tagged/tidyr" class="post-tag" title="show questions tagged &#39;tidyr&#39;" rel="tag">tidyr</a> may not be designed for this kind of data cleaning. Or is there any way <code>separate()</code> can work with NAs? Thank you very much for taking your time.</p>
  
  <p>Here is an updated sample based on the comments. Say I want to separate characters in y and create new columns. If I remove the row with NA, <code>separate()</code> will work. But, I do not want to delete the row, what could I do?</p>
  
  <pre><code>x &lt;- c("a-1","b-2","c-3")
  y &lt;- c("d-4","e-5", NA)
  z &lt;- c("f-6", "g-7", "h-8")
  
  foo &lt;- data.frame(x,y,z, stringsAsFactors = F)
  
  ana &lt;- foo %&gt;%
     separate(y, c("part1", "part2"))
  
  # &gt; foo
  #    x    y   z
  # 1 a-1  d-4 f-6
  # 2 b-2  e-5 g-7
  # 3 c-3 &lt;NA&gt; h-8
  # &gt; ana &lt;- foo %&gt;%
  # +        separate(y, c("part1", "part2"))
  # Error: Values not split into 2 pieces at 3
  </code></pre>