On Wed, May 9, 2012 at 4:19 PM, R. Michael Weylandt <michael.weyla...@gmail.com> wrote: > Good reproducible example ;-) > > Easiest is probably just: > > cbind(tencor, ThisRowMean = rowMeans(tencor[, 4:8]))
Actually, after frying my brain on tapply() and sapply() I found that just plain apply() does what I need: tencor$mean <- apply(tencor[4:8], 1, FUN=mean) This way I'm also not tied to just mean() as aggregator but can use any homemade function (this would have been my followup question had I followed your advice ;-) Thanks! robert ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.