cbind multiple, individual columns in a single data frame using column numbers
<p>I have a single data frame of 100 columns and 25 rows. I would like to cbind different groupings of columns (sometimes as many as 30 columns) in several new data frames without having to type out each column name every time.
<em>Some columns that i want fall individually e.g. 6 and 72 and some do lie next to each other e.g. columns 23, 24, 25, 26 (23:26).</em></p>

<p>Usually i would use:</p>

<pre><code>z &lt;- cbind(visco$fish, visco$bird)
</code></pre>

<p>for example, but i have too many columns and need to create too many new data frames to be typing the name of every column that i need every time. Generally i do not attach my data.</p>

<p>I would like to use column numbers, something like:</p>

<pre><code>z &lt;- cbind(6 , 72 , 23:26, data=visco) 
</code></pre>

<p>and also retain the original column names, not the automatically generated V1, V2. I have tried adding deparse.level=2 but my column names then become "visco$fish" rather than the original "fish" </p>

<p>I feel there should be a simple answer to this, but so far i have failed to find anything that works as i would like.</p>