Re: [R] How to arrange the data

2010-12-17 Thread Arnau Mir (CTI-UIB)
El 17/12/10 10:40, Amy Milano escribió: > Dear R helpers > > I have one data as given below. > > date value1 value2 value3 > 30-Nov-2010 100 40 61 > 25-Nov-2010 108 31 88 > 1

Re: [R] How to arrange the data

2010-12-17 Thread Alain Guillet
Hi, You can use the reshape package and the melt function : melt(data, id="date") Alain On 17-Dec-10 10:40, Amy Milano wrote: Dear R helpers I have one data as given below. date value1 value2 value3 30-Nov-2010 100 40

Re: [R] How to arrange the data

2010-12-17 Thread Gerrit Eichner
Hello, Amy, take a look at ?reshape In your case, I think, reshape( yourdatafame, varying = c( "value1", "value2", "value3"), v.name = "amount", times = c( "value1", "value2", "value3"), timevar = "name", direction = "long") should work. Hth -- Gerrit On Fri, 17 Dec 2010,

[R] How to arrange the data

2010-12-17 Thread Amy Milano
Dear R helpers I have one data as given below. date value1  value2 value3 30-Nov-2010   100 40 61 25-Nov-2010   108 31 88 14-Sep-2010    11 180