~/ learn/ afm-112/ cards/ The pivot, as a formula
1 of 11

In R, type the aggregate() call that gives the mean amount per province from orders, using the formula interface.

In R, type the aggregate() call that gives the mean amount per province from orders, using the formula interface.

Answer

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

amount grouped by prov; data = orders; FUN = mean with no parentheses. A four-row data frame — AB 1150, BC 453.33, ON 498.75, QC 161.67.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/19f65a38-849a-4154-88f1-f87a606087d6/flashcard utf-8 LF