title: convert dataframe to list by row with named vectors in R
body: <p>Suppose I have the following dataframe:</p>
  
  <pre><code>  | a | b | c |
  x | 1 | 2 | 3 |
  y | 4 | 5 | 6 |
  z | 7 | 8 | 9 |
  </code></pre>
  
  <p>I would like to convert it into a list by row, with each containing a named vector, which is basically the equivalent of the output of <code>list(x=c(a=1,b=2,c=3), y=c(a=4,b=5,c=6), x=c(a=7,b=8,c=9))</code>:</p>
  
  <pre><code>$x
  a b c 
  1 2 3 
  
  $y
  a b c 
  4 5 6 
  
  $x
  a b c 
  7 8 9 
  </code></pre>
  
  <p>How would I go about doing this?</p>