Skip to content

how can I give same name to column and row?

3 messages · Kristi Glover, Pascal Oettli, David L Carlson

#
Hello,

?colnames

Regards,
Pascal


Le 20/09/2012 11:48, Kristi Glover a ?crit :
#
It does that automatically. Just assign the names you want to the data.frame
before you compute the correlation matrix:
A           B           C           D           E
A  1.00000000 -0.08053608 -0.05444754  0.02173336 -0.31879440
B -0.08053608  1.00000000 -0.02621494  0.16279797 -0.19011677
C -0.05444754 -0.02621494  1.00000000 -0.18518459  0.37355793
D  0.02173336  0.16279797 -0.18518459  1.00000000 -0.05316086
E -0.31879440 -0.19011677  0.37355793 -0.05316086  1.00000000
[1] "A" "B" "C" "D" "E"
[1] "A" "B" "C" "D" "E"

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352