title: Turning a dataframe into named list
body: <p>I have a data frame of colors and ids and want to turn them into a list with the colors as the <code>name</code> and the id as the <code>value</code></p>
  
  <pre><code>colors &lt;- data.frame(color = c('Gold', 'Green', 'Red'), id = c('1','2','3'))
  </code></pre>
  
  <p>this is a small sample of the data frame, as there are a lot more rows.</p>
  
  <p>I am trying to get the results to be equivalent as the output when you write:      </p>
  
  <pre><code>colorlist &lt;- list('Gold' = 1, 'Green' = 2, 'Red' = 3)
  </code></pre>