On Mon, Apr 4, 2011 at 3:40 PM, Mark Novak <mnov...@ucsc.edu> wrote: > Thank you very much Gabor! It looks like that's gonna work wonderfully. I > didn't even know 'ave' existed. > > For others out there: I only needed to add a comma: dat[,c("Site", > "Plot", "Sp")]
Actually, if dd is a data frame dd[, ix] and dd[ix] give the same result. e.g. > dd <- data.frame(a = 1:3, b = 11:13, c = 21:23) > identical(dd[, c("b", "c")], dd[c("b", "c")]) [1] TRUE > Small follow up Q: Is there any reason to use 'aggregate' vs. 'ave' in > general? aggregate reduces the data to fewer rows. ave adds a potentially additional column to the original data. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com ______________________________________________ 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.