title: Move NA to the bottom
body: <p>I'm looking for a simple way to move all rows with at least one NA to the bottom of the dataframe/datatable. For example :</p>
  
  <pre><code>&gt; df &lt;- data.table(aaa=c(1,2,3,4,NA,6,7),
                     bbb=c(1,9,5,NA,3,NA,9),
                     ccc=c(NA,3,NA,4,8,NA,2)
                     )
  &gt; df
     aaa bbb ccc
  1:   1   1  NA
  2:   2   9   3
  3:   3   5  NA
  4:   4  NA   4
  5:  NA   3   8
  6:   6  NA  NA
  7:   7   9   2
  </code></pre>
  
  <p>would become something like this :</p>
  
  <pre><code>&gt; df2 &lt;- moveNAtoBottom(df)
  &gt; df2
     aaa bbb ccc
  1:   2   9   3
  2:   7   9   2
  3:   1   1  NA
  4:   3   5  NA
  5:   4  NA   4
  6:  NA   3   8
  7:   6  NA  NA
  </code></pre>
  
  <p>I.e. all columns with no NA at the top. </p>
  
  <p>Notes : </p>
  
  <ul>
  <li>for now, I don't really care if any sorting is applied or not to the rows, or if the order is kept, or reversed... as long as the table now has two parts, the top one without NAs, the bottom one with NAs</li>
  <li>this can be on dataframes or datatables</li>
  <li>dependencies are ok</li>
  </ul>
  
  <p>Better yet, if I could be able to specify the columns on which the search for the NAs must be applied. E.g., still with the previous example :</p>
  
  <pre><code>&gt; df3 &lt;- moveNAtoBottom(df, applyTo = c("bbb", "ccc"))
  &gt; df3
     aaa bbb ccc
  1:   2   9   3
  2:  NA   3   8
  3:   7   9   2
  4:   1   1  NA
  5:   3   5  NA
  6:   4  NA   4
  7:   6  NA  NA
  </code></pre>
  
  <p>Thanks</p>