Displaying 1 result from an estimated 1 matches for "shoulsd".
Did you mean:
should
2006 Jul 06
2
tapply question
...8 12 14
3 0 6 0 15
then the resulting data frame would be exactly the same except
that the AAA column would be
6 comes from (11 + 1)/2
7 comes from (12 + 2)/2
3 stays 3 because the element in the other AAA is zero
so i don't want to average that one. it shoulsd just stay 3.
So, I do
DF[DF == 0]<-NA
rowaverage<-function(x) x[rowMeans(forecastDf[x],na.rm=TRUE)
revisedDF<-tapply(seq(DF),names(DF),rowmeans)
there are two problems with this :
1) i need to go through the rows of the same name, not the columns
so i don't think seq(DF) is right...