Re: [R] Column renaming

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon, 05 May 2008 14:59:18 -0400

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 <cbarnaby_at_wrightsoft.com> 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 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
>
> ______________________________________________
> R-help_at_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_at_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. Received on Mon 05 May 2008 - 19:21:41 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 - 20:30:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive