[R] RES: Change name of a specific column of a data frame

From: Leandro Marino <leandro_at_cesgranrio.org.br>
Date: Tue, 01 Jul 2008 16:36:25 -0300


You can use names(database)[position]

where position is the number of the column that you want to rename!

Leandro Marino

-----Mensagem original-----
De: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org]Em nome de naw3_at_duke.edu
Enviada em: terca-feira, 1 de julho de 2008 16:18 Para: R-help_at_r-project.org
Assunto: [R] Change name of a specific column of a data frame

Hi,

Sorry for the simple question. Is there a way to change the name of only one column of an existing data frame?

I know colnames allows you to set the name of all the columns, but only one column in the middle of my data frame needs a new name.

Thanks,
-Nina



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 Tue 01 Jul 2008 - 19:42:25 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 Tue 01 Jul 2008 - 20:33:12 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