Re: [R] cast in reshape and reshape2

2011-12-26 Thread Hadley Wickham
>> ?plyr::summarise seems pretty helpful to me.  If you can do better, >> please submit a patch - they are very much appreciated. > > > My failure to find it stemmed from it not being mentioned in any way in > package reshape2's help files, but maybe I was mistaken that it was meant to > be used in

Re: [R] cast in reshape and reshape2

2011-12-23 Thread David Winsemius
On Dec 23, 2011, at 9:23 PM, Hadley Wickham wrote: Have you looked at the .summarise argument to dcast? That seems to deliver the same sort of results one gets with base::aggregate. Actually I see after looking at examples on the plyr-reshape- googlegroups group that it is not '.summarise

Re: [R] cast in reshape and reshape2

2011-12-23 Thread Hadley Wickham
>> Have you looked at the .summarise argument to dcast? That seems to deliver >> the same sort of results one gets with base::aggregate. > > > Actually I see after looking at examples on the plyr-reshape-googlegroups > group that it is not '.summarise' but rather 'summarise'. Unfortunately > there

Re: [R] cast in reshape and reshape2

2011-12-23 Thread Hadley Wickham
On Fri, Dec 23, 2011 at 1:58 PM, Kaiyin Zhong wrote: >> library(reshape2) >> x = melt(airquality, id=c('month', 'day')) > > With reshape I can cast with multiple functions: > >> library(reshape) >> cast(x, month+variable~., c(mean,sd)) >   month variable       mean         sd > 1      5    ozone  

Re: [R] cast in reshape and reshape2

2011-12-23 Thread David Winsemius
On Dec 23, 2011, at 5:58 PM, David Winsemius wrote: On Dec 23, 2011, at 2:58 PM, Kaiyin Zhong wrote: library(reshape2) x = melt(airquality, id=c('month', 'day')) With reshape I can cast with multiple functions: library(reshape) cast(x, month+variable~., c(mean,sd)) month variable

Re: [R] cast in reshape and reshape2

2011-12-23 Thread David Winsemius
On Dec 23, 2011, at 2:58 PM, Kaiyin Zhong wrote: library(reshape2) x = melt(airquality, id=c('month', 'day')) With reshape I can cast with multiple functions: library(reshape) cast(x, month+variable~., c(mean,sd)) month variable mean sd 1 5ozone 23.615385 22.2244

[R] cast in reshape and reshape2

2011-12-23 Thread Kaiyin Zhong
> library(reshape2) > x = melt(airquality, id=c('month', 'day')) With reshape I can cast with multiple functions: > library(reshape) > cast(x, month+variable~., c(mean,sd)) month variable mean sd 1 5ozone 23.615385 22.224449 2 5 solar.r 181.296296 115.075499 3