I've got matrix like this:
    a    b    c
x   1    2    3
y   3    3    2
I need to transform it to data.frame like below
x a 1 
x b 2 
x c 3 
y a 3 
y b 3 
y c 2 
I know that split() should work, but I can not set a,b,c as second names of rows. What should I do?
 
    