Displaying 1 result from an estimated 1 matches for "sequeeze".
Did you mean:
queeze
2010 Sep 09
1
"sequeeze" a data frame
Hi, suppose I have a data frame as below:
dat<-cbind(expand.grid(id=c(1,2,3),time=c(0,3,6),mode=c('R','L'),rep=(1:3)),y=rnorm(54))
I kind of want to "squeeze" the data frame into a new one with averaged "y" over
"rep" for the same id, time and mode. taking average is easy with tapply:
tapply(dat$y, list(dat$id, dat$time, dat$mode), mean)
But I