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

wu sz r.shengzhe at gmail.com
Tue Jul 19 12:42:14 CEST 2005


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




More information about the R-help mailing list