Extract a single dplyr tbl_df row as a vector
<p>How can one extract a single row from a <code>tbl_df</code> as a vector?  Simple subsetting with <code>[]</code> brackets yields a 1-row <code>tbl_df</code>:</p>

<pre><code>library(dplyr)
dat &lt;- as_data_frame(mtcars)

dat[2, ]

Source: local data frame [1 x 11]

    mpg   cyl  disp    hp  drat    wt  qsec    vs    am  gear  carb
  (dbl) (dbl) (dbl) (dbl) (dbl) (dbl) (dbl) (dbl) (dbl) (dbl) (dbl)
1    21     6   160   110   3.9 2.875 17.02     0     1     4     4
</code></pre>

<p>A similar problem to <a href="https://stackoverflow.com/questions/21618423/extract-a-dplyr-tbl-column-as-a-vector">Extract a dplyr tbl column as a vector</a>, but with (I think) some different solutions.</p>