reshape2 and wide (imputed) time variables
<p>I know <code>reshape</code> from base R can convert to a long format where the time is imputed from the stub variable names <code>A</code> and <code>B</code>, for example:</p>

<pre><code>wide = data.frame(A.2010 = c('a', 'b', 'c'),
                  A.2011 = c('f', 'g', 'd'),
                  B.2010 = c('A', 'B', 'C'),
                  B.2011 = c('G', 'G', 'H'),
                  z = runif(3),
                  x = runif(3))

wide
#  A.2010 A.2011 B.2010 B.2011         z          x
#1      a      f      A      G 0.3626823 0.67212468
#2      b      g      B      G 0.3726911 0.09663248
#3      c      d      C      H 0.9807237 0.31259394
</code></pre>

<p>Becomes:</p>

<pre><code>reshape(wide, direction = 'long', sep = '.',
        varying = c('A.2010', 'A.2011', 'B.2010', 'B.2011'))
#               z          x time A B id
#1.2010 0.3626823 0.67212468 2010 a A  1
#2.2010 0.3726911 0.09663248 2010 b B  2
#3.2010 0.9807237 0.31259394 2010 c C  3
#1.2011 0.3626823 0.67212468 2011 f G  1
#2.2011 0.3726911 0.09663248 2011 g G  2
#3.2011 0.9807237 0.31259394 2011 d H  3
</code></pre>

<p>Can I accomplish the same with <code>reshape2::melt</code>?</p>