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

______________________________________________
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.

Reply via email to