Re: [R] Averaging across rows columns
Check out rowMeans to average over replicate columns first, ie: means - data.frame(t1=rowMeans(a[,1:3]), t2=rowMeans(a[,4:6]), etc) Then, if you want to aggregate every 14 rows: aggregate(means, by=list(rows=rep(1:(nrow(means)/14), each=14)), mean) Or
Re: [R] Averaging across rows columns
michael watson (IAH-C) wrote: Check out rowMeans to average over replicate columns first, ie: means - data.frame(t1=rowMeans(a[,1:3]), t2=rowMeans(a[,4:6]), etc) Then, if you want to aggregate every 14 rows: aggregate(means,