Q. In dplyr, how do you calculate the sum and mean of a numeric variable named quantity for each group?
β
Correct Answer: (A)
summarize(total = sum(quantity), average = mean(quantity))