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

Spencer Graves spencer.graves at pdf.com
Mon Oct 20 21:09:18 CEST 2003


Consider the following: 

DF <- data.frame(a=1:2, b=3:4)
names(DF) <- letters[1:2]
DF
dimnames(DF)[[2]][2] <- "z"
DF

      This example illustrates two different ways to do what I 
understood from your question.  Answered? 

      spencer graves


Rajarshi Guha wrote:

>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