Separate a a data frame into its individual columns
<p>This seems like a fairly basic question, but I have been stuck on it for some time now. Would appreciate any help.</p>

<p>I have a data frame with a large number of columns, and want to split it into its individual columns, retaining the names. For instance, given the data frame <code>df</code> in the below code: </p>

<pre><code>df = data.frame(a=runif(10),b=runif(10),c=runif(10))

df
#           a         b          c
# 1  0.2779563 0.1412121 0.81080549
# 2  0.9312947 0.2074081 0.23266019
# 3  0.2001917 0.8405399 0.79820815
# 4  0.3866977 0.4979865 0.57364238
# 5  0.2644731 0.2714174 0.24188040
# 6  0.1973641 0.3027505 0.01130486
# 7  0.7657212 0.1042998 0.69974274
# 8  0.6424601 0.4570072 0.91322978
# 9  0.3754743 0.5670109 0.03320163
# 10 0.5413522 0.2577974 0.48067775
</code></pre>

<p>I would like to have a function that would basically accomplish what the below lines of code do individually (assign the values of each column of <code>df</code> to an <em>eponymous</em> vector) -</p>

<pre><code>a &lt;- df$a; b &lt;- df$b; c &lt;- df$c

a
# [1] 0.2779563 0.9312947 0.2001917 0.3866977 0.2644731 0.1973641 0.7657212
# [8] 0.6424601 0.3754743 0.5413522
</code></pre>

<p>Any ideas?</p>