Re: [R] help: how to change the column name of data.frame

From: wu sz <r.shengzhe_at_gmail.com>
Date: Tue 19 Jul 2005 - 20:42:14 EST

Thanks a lot! But DF[c(4,6)] <- DF[c(6,4)] seems to just exchange the data, not the names. If exchanging the columns(both data and names) needs two steps?

DF[c(4,6)] <- DF[c(6,4)]
names(DF)[c(4,6)] <- names(DF)[c(6,4)]

Shengzhe



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jul 19 20:47:42 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:46 EST