In R, type the call that gives the mean amount for every province × channel combination.
In R, type the call that gives the mean amount for every province × channel combination.
Answer
aggregate(amount ~ prov + channel, data = orders, FUN = mean)
Two groupings joined with +. Eight rows in long form — ON Online 465, ON Store 532.5 — the cells of the Rows × Columns pivot.