title: How to name each variable using melt
body: <p>I have a matrix that I want to reform for plotting in <code>ggplo2</code> using the <code>melt</code> function from <code>reshape2</code> but cannot find a way to add custom header names.  </p>
  
  <pre><code>#Create toy data
  MyData &lt;- matrix(rnorm(15,500), nrow = 5, ncol = 3, dimnames = list(
      c("Unknown","0-4","4-9","10-14","15-19"),c("Area1","Area2","Area3")))
  
  Dat2 &lt;- melt(MyData, value.name = "Count")
  
  #Reform data using melt, define Count as value name
  MyData2 &lt;- melt(MyData, value.name = "Count")
  </code></pre>
  
  <p>This gets me what I want but then operations that follow have to refer to the <code>Var1</code> and <code>Var2</code>.  </p>
  
  <p>I tried naming them explicitly using <code>variable.name</code>:</p>
  
  <pre><code>MyData2 &lt;- melt(MyData, value.name = "Count",
      variable.name = c("AgeGroup", "Geo"))
  </code></pre>
  
  <p>I can of course name them after the fact using <code>colnames()</code> but would like to do it using <code>melt</code>.  Is this possible?  Do I need to back up?</p>