[R] Column renaming

Gabor Grothendieck ggrothendieck at gmail.com
Mon May 5 20:59:18 CEST 2008


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.
>



More information about the R-help mailing list