[Fwd: Re: [R] vectorization of a data-aggregation loop]

2005-02-02 Thread Christoph Lehmann
great! many thanks, Phil Cheers christoph Phil Spector wrote: Christoph - I think reshape is the function you're looking for: tt <- data.frame(cbind(c(1,1,1,1,1,2,2,2,3,3,3,3), + c(10,12,8,33,34,3,27,77,34,45,4,39), c('a', 'b', 'b', 'a', 'c', 'c', 'c', + 'a', 'b', 'a', 'b', 'c'))) reshape(aggre

Re: [R] vectorization of a data-aggregation loop

2005-02-01 Thread Marc Schwartz
On Tue, 2005-02-01 at 23:28 +0100, Christoph Lehmann wrote: > Hi > I have a simple question: > > the following data.frame > > id iwv type > 1 1 1a > 2 1 2b > 3 1 11b > 4 1 5a > 5 1 6c > 6 2 4c > 7 2 3c > 8 2 10a > 9 3 6b >

[R] vectorization of a data-aggregation loop

2005-02-01 Thread Christoph Lehmann
Hi I have a simple question: the following data.frame id iwv type 1 1 1a 2 1 2b 3 1 11b 4 1 5a 5 1 6c 6 2 4c 7 2 3c 8 2 10a 9 3 6b 10 3 9a 11 3 8b 12 3 7c shall be aggregated into the form: id t.a t.b t.