Skip to content
Prev 167071 / 398502 Next

Moving a Data Frame Column

Dear R-Users
if I have a data frame (or zoo data) as follows:

Run  Bike Walk Drive
1       2      7     5
5       2      4     2 
8       3      2     1

How can I re-order it so that it reads:  

Drive Run  Bike Walk 
  5      1      2     7   
  2      5      2     4    
  1      8      3     2   
i.e. "Drive" has been copied and pasted to the left most column.

Thanks for your help.

James