>> aggregate(dat$value, list(dat$x, dat$y), mean)
> Group.1 Group.2 x
> 1 1 1 15
> 2 1 2 30
>> newdat <-aggregate(dat$value, list(dat$x, dat$y), mean)
>> names(newdat) <- c("x","y",bquote("mean(value)") )
That bquote isn't necessary because you're already working with strings.
c(x = 1, y = 2, "mean(value)" = 3)
Hadley
--
http://had.co.nz/
______________________________________________
[email protected] 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.