[R] changing the the column header in a data.frame

James MacDonald jmacdon at med.umich.edu
Mon Oct 20 21:03:12 CEST 2003


If you data.frame is called df, then

names(df) <- c(new names here)

You can also do individual names

names(df)[1] <- "new name for first column"

HTH

Jim



James W. MacDonald
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623

>>> Rajarshi Guha <rxg218 at psu.edu> 10/20/03 02:36PM >>>
Hi,
  is there any way I can change the column header in a data.frame?

Thanks,

-------------------------------------------------------------------
Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
Eureka!
-- Archimedes

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list