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

2010-06-29 Thread Dimitri Liakhovitski
Thank you very much for a reference to "reshape". I found that melt(MyData) - and then resorting - gives me exactly what I want! Dimitri On Tue, Jun 29, 2010 at 1:46 PM, Henrique Dallazuanna wrote: > Try this: > > reshape(MyData, direction = 'long', varying = list(c('jan', 'feb')), idvar = > 2:3

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

2010-06-29 Thread Henrique Dallazuanna
Try this: reshape(MyData, direction = 'long', varying = list(c('jan', 'feb')), idvar = 2:3) On Tue, Jun 29, 2010 at 2:22 PM, Dimitri Liakhovitski < dimitri.liakhovit...@gmail.com> wrote: > Hello, everyone! > I have a very simple task - I have a data frame (see MyData below) and > I need to stack

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

2010-06-29 Thread Hadley Wickham
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 t