title: How to include a Surv object as a new column in a data.table?
body: <p>I'm performing survival analysis, and I want to create a <code>Surv</code> object as its own column in a <code>data.table</code>. Although <code>Surv</code> objects are considered vectors, I can't use them to make new column since they are actually a 2 column matrix. Is there an elegant way to include <code>Surv</code> objects without splitting them into separate columns?</p>
  
  <p>This is what a <code>Surv</code> object looks like.</p>
  
  <pre class="lang-r prettyprint-override"><code>DT[,Surv(time, status)]
  #&gt;  [1]   9   13   13+  18   23   28+  31   34   45+  48  161+   5    5    8 
  #&gt; [15]   8   12   16+  23   27   30   33   43   45
  </code></pre>
  
  <p>Here is an example of what I want to do:</p>
  
  <pre class="lang-r prettyprint-override"><code>library(data.table)
  library(survival)
  
  DF &lt;- as.data.frame(survival::aml)
  DT &lt;- as.data.table(survival::aml)
  
  # Does work
  DF$survival &lt;- Surv(DF$time, DF$status)
  
  # Does not work
  DT[,survival:=Surv(time, status)]
  </code></pre>