Skip to content

Mean according to the combination of two factors

2 messages · Li Li, Rui Barradas

#
Hello,

Try the following.

# make up some data
dat <- data.frame(values = rnorm(100), experiment = sample(10, 100, 
TRUE), composite = sample(17, 100, TRUE))
aggregate(values ~ experiment + composite, data = dat, FUN = mean)


Hope this helps,

Rui Barradas
Em 11-01-2013 23:26, li li escreveu: