AE 04: Sales taxes + data joining
Application exercise
Getting started
Packages
We’ll use the tidyverse package for this analysis.
Data
The data are available in the data folder.
And let’s take a look at the data.
# add code hereJoining
Join the sales tax data with region data and save the joined data frame as a new data frame, not overwriting either data frame that goes into the join.
# add code hereCalculate the average sales tax of states in each region. What is surprising in the output?
# add code hereIdentify the state with NA for region.
# add code hereSuprised? You shouldn’t be… Read here for more information on why you shouldn’t be surprised.
Apply a fix for the NA in region, and calculate the mean sales taxes for regions again. Display the results in ascending order of mean sales tax.
# add code hereJoining another way
Accomplish the same task using a different join this time.
# add code here