How to "melt" row wise instead of column wise in R?
<p>I have a data frame <code>A</code> that I would like to melt row wise instead of column wise to look like <code>B</code> (which also excludes observations with <code>NA</code> in them). Can this be accomplished with the "melt" function? </p>

<pre><code>A &lt;- read.table(text="  Id1 Id2 Var1    Var2    Var3    
            1   1   1   2   NA  
            1   2   NA  3   4   
            1   3   5   6   7   ", header=T)


B &lt;- read.table(text="  Id1 Id2 NewVar  
    1   1   1   
    1   1   2   
    1   2   3   
    1   2   4   
    1   3   5   
    1   3   6   
    1   3   7   ", header=T)
</code></pre>

<p>I found an <a href="https://stackoverflow.com/questions/19169820/row-wise-manipulation-on-large-dataset">answer</a> to a similar question but the function seems like overkill and is beyond my current R skills. </p>