title: data.frame rows to a list
body: <p>I have a data.frame which I would like to convert to a list by rows, meaning each row would correspond to its own list elements. In other words, I would like a list that is as long as the data.frame has rows.</p>
  
  <p>So far, I've tackled this problem in the following manner, but I was wondering if there's a better way to approach this.</p>
  
  <pre><code>xy.df &lt;- data.frame(x = runif(10),  y = runif(10))
  
  # pre-allocate a list and fill it with a loop
  xy.list &lt;- vector("list", nrow(xy.df))
  for (i in 1:nrow(xy.df)) {
      xy.list[[i]] &lt;- xy.df[i,]
  }
  </code></pre>