[R] Reshape with multiple aggregation functions

2012-01-18 Thread dimitris fekas
I have a data frame and I would like to reshape it to wide format while at the same time applying different aggregate functions to each column AND at times multiple aggregate functions:   test1 = data.frame(         id = c(rep('101',8),rep('102',8)),         phase  =

Re: [R] Reshape with multiple aggregation functions

2012-01-18 Thread Tal Galili
This sounds like a job for the melt/cast scheme for the reshape package. There is a tutorial for using it here: http://www.r-statistics.com/2012/01/aggregation-and-restructuring-data-from-r-in-action/ Good luck, Tal Contact

Re: [R] Reshape with multiple aggregation functions

2012-01-18 Thread pengcafe
Hello, and thanks for your answer, I have melted the data already and can reshape it with cast alright, but I still can find no way to provide a list of aggregate functions per column, nor multiple aggregate functions for some of them (i.e. mean AND stdev) -- View this message in context:

Re: [R] Reshape with multiple aggregation functions

2012-01-18 Thread Jean V Adams
dimitris fekas wrote on 01/18/2012 03:21:44 AM: I have a data frame and I would like to reshape it to wide format while at the same time applying different aggregate functions to each column AND at times multiple aggregate functions: test1 = data.frame( id =