There is a rename function in the reshape package and also one in the memisc package.
On Mon, May 5, 2008 at 10:48 AM, Chip Barnaby <[EMAIL PROTECTED]> wrote: > 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 [EMAIL PROTECTED] > Vice President of Research > Wrightsoft Corp. 781-862-8719 x118 voice > 131 Hartwell Ave 781-861-2058 fax > Lexington, MA 02421 www.wrightsoft.com > > ______________________________________________ > 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. > ______________________________________________ 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.