Hi R-helpers,

I have written this line of code:

> data<-cbind(data[,1],data[,2:6],data[,18],data[,7:17])

to reorder the columns of my dataframe, but I'm losing the column names of
my 1st and 18th columns (they are now named data[,1] and data[,18]
respectively).

Can I use cbind to do this (without losing my column names) or is there
another way?

Many thanks,

Mark Na

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to