title: Using melt with matrix or data.frame gives different output
body: <p>Consider the following code:</p>
  
  <pre><code>set.seed(1)
  M = matrix(rnorm(9), ncol = 3)
  dimnames(M) = list(LETTERS[1:3], LETTERS[1:3])
  
  print(M)
             A          B         C
  A -0.6264538  1.5952808 0.4874291
  B  0.1836433  0.3295078 0.7383247
  C -0.8356286 -0.8204684 0.5757814
  
  melt(M)
  
    Var1 Var2      value
  1    A    A -0.6264538
  2    B    A  0.1836433
  3    C    A -0.8356286
  4    A    B  1.5952808
  5    B    B  0.3295078
  6    C    B -0.8204684
  7    A    C  0.4874291
  8    B    C  0.7383247
  9    C    C  0.5757814
  </code></pre>
  
  <p>If i call <code>melt</code> using a <code>data.frame</code>, i get a different result:</p>
  
  <pre><code>DF = data.frame(M)
  
  melt(DF)
  
    variable      value
  1        A -0.6264538
  2        A  0.1836433
  3        A -0.8356286
  4        B  1.5952808
  5        B  0.3295078
  6        B -0.8204684
  7        C  0.4874291
  8        C  0.7383247
  9        C  0.5757814
  </code></pre>
  
  <p>I found the docs a little bit confusing on this, so anyone can help me understand this behavior? Can i get the first result using a data.frame?</p>