Re: [R] Change One Column Name in Data Frame

2012-05-15 Thread Rich Shepard
On Tue, 15 May 2012, R. Michael Weylandt wrote: colnames(x)[2] <- "Cow" Michael, Thank you. Rich __ 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-

Re: [R] Change One Column Name in Data Frame

2012-05-15 Thread R. Michael Weylandt
x <- data.frame(a = 1:5, b = rnorm(5)) colnames(x) colnames(x)[2] <- "Cow" x HTH, Michael On Tue, May 15, 2012 at 12:30 PM, Rich Shepard wrote: >  The data frame has 61 columns and one column name needs to be changed. The > colnames() function can be used to change all of them when passed a v

[R] Change One Column Name in Data Frame

2012-05-15 Thread Rich Shepard
The data frame has 61 columns and one column name needs to be changed. The colnames() function can be used to change all of them when passed a vector of names, but can it also change a single name? If not, is there a way to change just the one column name? Rich