Transpose in R grouping by row and column : <p>How do I transpose the data-frame with the following condition in R? The normal transpose doesn't work in this case. </p>

<p><a href="http://i.stack.imgur.com/WITFm.jpg" rel="nofollow">Current data</a></p>

<p><a href="http://i.stack.imgur.com/4mVJO.jpg" rel="nofollow">Expected output</a></p>

<p>Thanks!</p>
