Displaying 1 result from an estimated 1 matches for "score_mean_iqr".
2011 Jun 03
0
ragged data.frame? using plyr
...y to do the following:
score_out.melt<-melt(score_out,id='day')
names(score_out.melt)<-c('day','id','score')
tblscore_mean<-tapply(score_out.melt$score,INDEX=score_out.melt$id,mean)
tblscore_iqr<-tapply(score_out.melt$score,INDEX=score_out.melt$id,IQR)
score_mean_iqr<-data.frame(id=names(tblscore_iqr),mean=tblscore_mean,iqr=tblscore_iqr)
However, as it turns out, my data look more like:
dat<-dat[-sam]
ldply(dlply(dat,.(id,day),adj.values),length)
So on different days I only have data for some of the id variables
which leads to a "ragged" dat...