Step through the pipeline: group_by(sex) tags the rows into groups, then summarize(fare = mean(fare)) turns each group into one mean.
group_by(sex)
summarize(fare = mean(fare))