title: how to pivot/unpivot (cast/melt) data frame?
body: <p>How can I 'unpivot' a table? What is the proper technical term for this?</p>
  
  <p>UPDATE: The term is called <strong>melt</strong></p>
  
  <p>I have a data frame for countries and data for each year</p>
  
  <pre><code>Country     2001    2002    2003
  Nigeria     1       2       3
  UK          2       NA       1
  </code></pre>
  
  <p>And I want to have something like </p>
  
  <pre><code>Country    Year    Value
  Nigeria    2001    1
  Nigeria    2002    2
  Nigeria    2003    3
  UK         2001    2
  UK         2002    NA
  UK         2003    1
  </code></pre>