title: return a list in a column in data.table
body: <p>I have a data.table in R, and I'm looking to calculate a list based on row values using data.tables. I've currently tried the following code as an example</p>
  
  <pre><code>library("data.table")
   dt &lt;- data.table (data.frame(name = c("A","B","C")), num = c(10,20,30))
  dt [,seq := list(replicate(5,num)),by = .I]
  </code></pre>
  
  <p>However, it doesn't generate the list but instead repeats the value in <code>num</code> column to the <code>seq</code> column. As shown below</p>
  
  <pre><code>name     num    seq
  A         10     10
  B         20     20
  C         30     30
  </code></pre>
  
  <p>The expected output is</p>
  
  <pre><code>name     num    seq
  A         10     list(10, 10, 10, 10, 10)
  B         20     list(20, 20, 20, 20, 20)
  C         30     list(30, 30, 30, 30, 30)
  </code></pre>
  
  <p>How do I go about with this?</p>