~/ learn/ afm-112/ cards/ One category → Rows; two → Rows × Columns; "for only…" → Filter
1 of 7

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.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/1d637167-c58d-497c-a60f-505e5466101d/flashcard utf-8 LF