title: How to skip over missing values while transforming DataFrame in Julia
body: <p>I would like to transform each element in a column in a Julia DataFrames.DataFrame but skip over missing values in doing so (let them stay in the table intact).</p>
  
  <p>As a simple example, we could do it in this way:</p>
  
  <pre><code>using DataFrames, DataFramesMeta
  
  @linq DataFrame(mode=[1,2,missing]) |&gt;
  transform(
      mode = map(x-&gt;(if x === missing missing elseif x in ([0:5...]) x+1 else missing end), :mode)
  )
  </code></pre>
  
  <p>But it looks more or less cluttered. Would there be more elegant or concise ways?</p>
  
  <p>I read Query.jl and DataFramesMeta.jl docs hoping to find a method by which I don't have to code skipping over missing values explicitly.</p>
  
  <p><strong>EDIT:</strong>
  I think the following is the best I can think of:</p>
  
  <pre><code>using DataFrames, DataFramesMeta, DataValues
  
  skipmap(f, c) = map(x-&gt;(if x===missing missing else f(x) end), c)
  
  @linq DataFrame(mode=[1,2,missing]) |&gt;
  transform(
      mode = skipmap(x-&gt;if x in ([0:5...]) x+1 else x end, :mode)
  )
  </code></pre>
  
  <p>I think it would be great if map() is extended in a way that it accepts a third parameter y (hence map(f,c,y)) and keep those elements intact in the array if they belong to y.</p>