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 <rshep...@appl-ecosys.com> 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 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 > > ______________________________________________ > 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. ______________________________________________ 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.