title: Convert data frame into vector
body: <p>I have a one row/column <code>dataframe</code> that I would like to convert into a value. </p>
  
  <pre><code>df &lt;- data.table(x=c(300))
  &gt;#     x
  &gt;# 1: 300
  </code></pre>
  
  <p>I've managed to do it by doing this:</p>
  
  <pre><code>b &lt;- as.list(df)[[1]]
  &gt;# [1] 300
  </code></pre>
  
  <p>so that <code>identical(b, 300) == T</code></p>
  
  <p>Is there a simpler way to achieve this? I understand this is a very simple question but I couldn't find a solution. Help?</p>