search for: junquian

Displaying 1 result from an estimated 1 matches for "junquian".

Did you mean: junqian
2011 Apr 25
1
average among one factor in a nested dataframe
I have two nested data frames: a<-rnorm(6) b<-rnorm(9) f1<-c("x1","x2","x3")) f2<-c("y1","y2") id<-c(1:6) a_df<-data.frame(cbind(id,f1,"y1",a)) id<-c(1:9) b_df<-data.frame(cbind(id,f1,"y2",b)) I want to preserve id and f1, but want to collapse f2 and take the corresponding mean values of a and b.