This is a very common mistake, you need to use the named argument FUN:
ave(state$inc, state$region, FUN = mean)
otherwise mean will be interpreted as another grouping variable (part of the … argument to ave.)
by James Palmer
This is a very common mistake, you need to use the named argument FUN:
ave(state$inc, state$region, FUN = mean)
otherwise mean will be interpreted as another grouping variable (part of the … argument to ave.)