title: Melting a cast data frame gives incorrect output
body: <p>I've encountered a strange behaviour in <code>cast</code>/<code>melt</code> from the <code>reshape</code> package. If I cast a <code>data.frame</code>, and then try to <code>melt</code> it, the <code>melt</code> comes out wrong. Manually unsetting the "df.melt" class from the cast <code>data.frame</code> lets it be melted properly.</p>
  
  <p>Does anyone know if this is intended behaviour, and if so, what is the use case when you'd want it?</p>
  
  <p>A small code example which shows the behaviour:</p>
  
  <pre><code>&gt; df &lt;- data.frame(type=c(1, 1, 2, 2, 3, 3), variable="n", value=c(71, 72, 68, 80, 21, 20))
  
  &gt; df
    type variable value
  1    1        n    71
  2    1        n    72
  3    2        n    68
  4    2        n    80
  5    3        n    21
  6    3        n    20
  
  &gt; df.cast &lt;- cast(df, type~., sum)
  &gt; names(df.cast)[2] &lt;- "n"
  
  &gt; df.cast
    type   n
  1    1 143
  2    2 148
  3    3  41
  
  &gt; class(df.cast)
  [1] "cast_df"    "data.frame"
  
  &gt; melt(df.cast, id="type", measure="n")
           type value value
  X.all.      1   143 (all)
  X.all..1    2   148 (all)
  X.all..2    3    41 (all)
  
  &gt; class(df.cast) &lt;- "data.frame"
  &gt; class(df.cast)
  [1] "data.frame"
  
  &gt; melt(df.cast, id="type", measure="n")
    type variable value
  1    1        n   143
  2    2        n   148
  3    3        n    41
  </code></pre>