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-
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
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
3 matches
Mail list logo