title: Sort null values last with DataTables in R
body: <p>I am currently using a <code>datatable</code> in an <code>rmarkdown</code> document to create a <code>flexdashboard</code>. I have a numeric column with NA's in it.  When I click to sort the column in descending order it puts the largest value first and the NA/null values last.  When I sort in ascending order it puts the NA/null values first and then the numeric values.  Is there a way to sort the null value last when sorting in ascending order?  It looks like <code>DataTables</code> might have a <a href="https://datatables.net/plug-ins/sorting/absolute" rel="nofollow noreferrer">plugin</a> for this very issue but I see it is <a href="https://rstudio.github.io/DT/plugins.html" rel="nofollow noreferrer">not supported</a> by the R DataTables version. I'm looking to be able to sort the numeric columns the same way RStudio does with a table when you view it.</p>
  
  <p>Here is a reproducible example of the functionality I am looking for:</p>
  
  <pre><code>library(DT)
  library(tidyverse)
  
  
  Table.with.null &lt;- tibble(Category=c("A","B","C","D"),
                            Numeric=seq(1,4),
                            Numeric.null=c(1,2,3,NA))
  
  datatable(Table.with.null,rownames=FALSE)
  </code></pre>
  
  <p>When I sort the <code>Numeric.null</code> column in <em>ascending</em> order the table should look like this:</p>
  
  <pre><code>Category  Numeric  Numeric.null
  A         1        1
  B         2        2
  C         3        3
  D         4        NA
  </code></pre>
  
  <p>Which it does.  When I sort <code>Numeric.null</code> column in <em>descending</em> order the table should look like this:</p>
  
  <pre><code>Category  Numeric  Numeric.null
  C         3        3
  B         2        2
  A         1        1
  D         4        NA
  </code></pre>