[R] Column names of a data frame

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Aug 26 11:52:04 CEST 2004


?names

data frames have names, rather column names (they are lists with extra 
structure).

On Thu, 26 Aug 2004, michael watson (IAH-C) wrote:

> I'm coming out with all the classic problems today ;-)
> 
> Can anyone tell me how to change the column names of an already existing
> data frame?  I've read the docs for ?data.frame and ?as.data.frame but
> can't figure it out.
> 
> I want to make a new data.frame from some of the columns of an existing
> data.frame, but when I do that, the new data.frame columns have the same
> names as the old data.frame's columns, and I want them to be
> different....
> 
> Sorry for the lame question....

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list