title: R merge data frame columns to a new column as a vector
body: <p>I need to merge all columns of data frame into a new column that will contain a vector(list) of the values in other columns. Something like this</p>
  
  <pre><code>n = c(2, 3, 5) 
  s = c(3,3,5)
  b = c(1,1,1)
  df = data.frame(n, s, b)
  
    n s b
  1 2 3 1
  2 3 3 1
  3 5 5 1
  </code></pre>
  
  <p>And I want to run a command that gives me something like this:</p>
  
  <pre><code>  n s b   v
  1 2 3 1 [2,3,1]
  2 3 3 1 [3,3,1]
  3 5 5 1 [5,5,1]
  </code></pre>
  
  <p>Basically, something like this</p>
  
  <pre><code>t(as.numeric(df[1,1:3]))
         [,1] [,2] [,3]
  [1,]    2    3    1
  </code></pre>
  
  <p>Gets me what I want for one row, but I can't figure out how do add it for all rows. I've tried various <code>apply</code> functions without much success.</p>
  
  <p>Thanks.</p>