>> 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/