~/ learn/ afm-112/ cards/ Pivot Tables: Aggregating and Comparing Groups
1 of 55

In R, type the call that totals amount by province — the same four rows as the pivot.

In R, type the call that totals amount by province — the same four rows as the pivot.

Answer

aggregate(amount ~ prov, data = orders, FUN = sum)

Values ~ Rows, the data frame, the function. AB 2300, BC 1360, ON 1995, QC 485 — alphabetical, like the pivot.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/2270a971-773d-43fd-9d95-c1c72fdac053/flashcard utf-8 LF