Re: [R] transposing a data frame from horizontal to vertical (stacking)

From: Hadley Wickham <>
Date: Tue, 29 Jun 2010 12:25:28 -0500

On Tue, Jun 29, 2010 at 12:22 PM, Dimitri Liakhovitski <> wrote:
> Hello, everyone!
> I have a very simple task - I have a data frame (see MyData below) and
> I need to stack the data (see result below).
> I wrote the syntax below - it's very basic and it does what I need.
> But I am sure what I am trying to do is a very typical task and there
> must be a much shorter/more elegant way of doing it.
> Any advice?



Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 29 Jun 2010 - 17:28:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 29 Jun 2010 - 17:30:44 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive