[R] Column renaming

Chip Barnaby cbarnaby at wrightsoft.com
Mon May 5 16:48:57 CEST 2008


Dear all,

Is there a less cumbersome way to rename a column by name (as opposed 
to index) than --

names( X)[ names[ X] == "bob"]<-"sue"

?

A semi-related question: how does one get the index of a column by 
name, something along the lines of col.index( X, "sue") ?


Chip Barnaby


---------------------------------------------------------
Chip Barnaby                   cbarnaby at wrightsoft.com
Vice President of Research
Wrightsoft Corp.               781-862-8719 x118 voice
131 Hartwell Ave               781-861-2058 fax
Lexington, MA 02421         www.wrightsoft.com



More information about the R-help mailing list