Hi all,
I have a very simple problem that I cannot seem to find the answer to. Consider
the following toy dataset:
x <- read.table(textConnection("V1 apples bananas cherries
indv.1 7 8 4 3
indv.2 7 7 4 9"), header = TRUE)
How would I change the column name of ONLY the first column, not the others?
Surely I should not have to re-specify the names of ALL the columns -- e.g.,
colnames(x) <- c("pears", "apples", "bananas", "cherries") -- if only the first
column name will change.
Thanks very much,
Josh
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.