Skip to content
Prev 26235 / 398502 Next

Suppressing name-wrangling in a data.frame

Is there a simple way to avoid name-wrangling in a dataframe?

Math operations on a dataframe cause R to correct the names(), for instance from "1" "2" "3" to "X1" "X2" "X3"

A workaround is to as.matrix() the dataframe, perform the math, then re-data.frame() it, but this seems like the long way home 

Thanks 
Steve Wisdom
1  2  3
1 1  6 11
2 2  7 12
3 3  8 13
4 4  9 14
5 5 10 15
X1 X2 X3
1  1  6 11
2  2  7 12
3  3  8 13
4  4  9 14
5  5 10 15
1  2  3
1 1  6 11
2 2  7 12
3 3  8 13
4 4  9 14
5 5 10 15
[1] "1" "2" "3"
[1] "X1" "X2" "X3"
_              
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    1              
minor    6.1            
year     2002           
month    11             
day      01             
language R