[R] names help?

rkevinburton at charter.net rkevinburton at charter.net
Wed Dec 31 17:31:53 CET 2008


I am unclear what names(x) <- does?

On the outset it seems relatively clear. 

But what if there are already names?

What if there are already names on the object and they are in a different order than specified in the names on the right hand side? I tried it and it just replaces what was there as seems the simplest approach. But doesn't that seem a little dangerous? If I swap names for a variable and then later reference the variable by name I would get unexpected results. Right?

Kevin



More information about the R-help mailing list