I have a data.frame that looks like this:
data.frame
# set example data df <- read.table(textConnection(\"item\\tsize\
aggregate(value ~ item + size + weight, FUN = mean, data=df) item size weight value 1 B 1 2 3 2 C 3 2 1 3 A 2 3 5