Try

require(gregmisc)
rename(data, from="old_name", to="new_name")


A Smile costs Nothing  
     But Rewards Everything

Happiness is not perfected until it is shared
                                                              -Jane Porter      
  


--- On Tue, 7/1/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Subject: [R] Change name of a specific column of a data frame
To: R-help@r-project.org
Date: Tuesday, July 1, 2008, 2:17 PM

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


      
        [[alternative HTML version deleted]]

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

Reply via email to