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.