How do you rename column names? i.e. V1 -- Apple; V2 -- Orange, etc.
I'm fairly new myself, but...
People will tell you:
1. See if just asking for help on the verb you want works
?rename #out of luck, never mind
2. If not, try some variations
?name #too bad: turns out this doesn't help here
3. If not, then search more widely
RSiteSearch(rename) # sadly that's too vague to help
4. If not, then ask here, giving a clear and concise example of your needs,
data, and expected result.
i.e.,I have
A - c(V1=2, V2=3)
How can I change the variable names?
But for really simple questions like this (which are more like the syntax of
the language than anything more complex, you will not regret buying An
Introduction to R, and something like Statistics an introduction using
R, both on Amazon for quick delivery.
The answer is that the function to get names also sets them if it is passed
an array of names, so:
A - c(V1=2, V2=3)
names(A)
[1] V1 V2
names(A) - c(Apple, Orange)
A
Apple Orange
2 3
__
R-help@stat.math.ethz.ch 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.