title: Fastest way to convert a matrix to a data.table
body: <p>What is the fastest way to convert a matrix like the following to a data.table?</p>
  
  <pre><code>mat &lt;- matrix(1:9, nrow = 3)
  
  1 2 3
  4 5 6
  7 8 9
  </code></pre>
  
  <p>I can convert this to a data.table with the code below</p>
  
  <pre><code>setDT(data.frame(mat))[]
  </code></pre>
  
  <p>But is this the fastest way? Can we do this without first converting it to a data.frame?</p>