Re: [R] Column renaming

From: hadley wickham <>
Date: Mon, 05 May 2008 12:08:13 -0500

On Mon, May 5, 2008 at 10:54 AM, Chip Barnaby <> wrote:
> Yes, someone else pointed out my typo, sorry.
> My issue here is that referring to columns by index is risky. Hard-coded
> indices will be buried in code and there will be trouble if (when) the data
> organization changes. So I am trying to learn how to work with names, but
> the language does not seem to allow that approach without some awkwardness.
> I guess I could write some helper functions.

There's the rename function in the reshape package:

X <- rename(X, c("bob" = "sue")



______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 05 May 2008 - 17:24:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 05 May 2008 - 17:30:36 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive