The state_estate_inheritance_taxes.csv file has information on the 17 US states that either have an estate tax or an inheritance tax. The columns are:
State
: The name of the stateestate_tax
: if the state has an estate tax
(yes/no)estate_tax_exemption
: How large the value of the estate
can be before it is taxedinheritance_tax
: If the state has an inhertiance tax
(yes/no)inheritance_tax_exemption
: The amount someone can
inherit before it is taxed.If a state is not listed, like New Hampshire, then it doesn’t have an estate or inheritance tax.
## State estate_tax estate_tax_exemption inheritance_tax
## 1 Connecticut yes 13,610,000.00 $ no
## 2 Hawaii yes 5,490,000.00 $ no
## 3 Illinois yes 4,000,000.00 $ no
## 4 Iowa no yes
## 5 Kentucky no yes
## 6 Maine yes 6,800,000.00 $ no
## 7 Maryland yes 5,000,000.00 $ yes
## 8 Massachusetts yes 2,000,000.00 $ no
## 9 Minnesota yes 3,000,000.00 $ no
## 10 Nebraska no yes
## 11 New Jersey no yes
## 12 New York yes 6,940,000.00 $ no
## 13 Oregon yes 1,000,000.00 $ no
## 14 Pennsylvania no yes
## 15 Rhode Island yes 1,774,583.00 $ no
## 16 Vermont yes 5,000,000.00 $ no
## 17 Washington yes 2,193,000.00 $ no
## inheritance_tax_exemption
## 1
## 2
## 3
## 4 0 $
## 5 1,000.00 $
## 6
## 7 0 $
## 8
## 9
## 10 100,000.00 $
## 11 25,000.00 $
## 12
## 13
## 14 0$
## 15
## 16
## 17
Create the graph seen in Brightspace. Make sure to use methods seen
in the course material using ggplot()
and the other
functions needed. The graph seen in Brightspace will be a close
approximation of the graph seen here
If there are multiple conditions you want to check for (like this
example where a state can have both, only inheritance, only estate, or
neither tax), you can use case_when()
similar to how you’d
use if_else()
. See the help menu here.
Hint: If you have 4 levels in a factor but only want three to appear in a legend and control the color of the third group, you can use something like:
values = c('A' = 'blue', 'B' = 'red', 'C' = 'yellow'),
na.value = 'purple'
Then ‘D’ won’t be in the legend but the shape that represents the ‘D’ rows will be purple.
The colors used in the graph are navy, gold3, lightblue, and grey90
The sales_tax_by_state.csv has info on the sales tax levied
by the different states. Read the data in and save it as
sales_tax
## state state_tax state_rank avg_local_tax max_local_tax
## 1 Alabama 4.00% 40 5.29% 7.50%
## 2 Alaska 0.00% 46 1.82% 7.85%
## 3 Arizona 5.60% 28 2.78% 5.30%
## 4 Arkansas 6.50% 9 2.95% 6.13%
## 5 California 7.25% 1 1.60% 4.75%
## 6 Colorado 2.90% 45 4.91% 8.30%
## 7 Connecticut 6.35% 12 0.00% 0.00%
## 8 Delaware 0.00% 46 0.00% 0.00%
## 9 Florida 6.00% 17 1.00% 2.00%
## 10 Georgia 4.00% 40 3.38% 5.00%
## 11 Hawaii 4.00% 40 0.50% 0.50%
## 12 Idaho 6.00% 17 0.03% 3.00%
## 13 Illinois 6.25% 13 2.61% 4.75%
## 14 Indiana 7.00% 2 0.00% 0.00%
## 15 Iowa 6.00% 17 0.94% 2.00%
## 16 Kansas 6.50% 9 2.15% 4.25%
## 17 Kentucky 6.00% 17 0.00% 0.00%
## 18 Louisiana 4.45% 37 5.11% 7.00%
## 19 Maine 5.50% 29 0.00% 0.00%
## 20 Maryland 6.00% 17 0.00% 0.00%
## 21 Massachusetts 6.25% 13 0.00% 0.00%
## 22 Michigan 6.00% 17 0.00% 0.00%
## 23 Minnesota 6.88% 6 1.16% 2.15%
## 24 Mississippi 7.00% 2 0.06% 1.00%
## 25 Missouri 4.23% 38 4.16% 5.88%
## 26 Montana 0.00% 46 0.00% 0.00%
## 27 Nebraska 5.50% 29 1.47% 2.00%
## 28 Nevada 6.85% 7 1.39% 1.53%
## 29 New Hampshire 0.00% 46 0.00% 0.00%
## 30 New Jersey 6.63% 8 0.02% 3.31%
## 31 New Mexico 4.88% 34 2.74% 4.06%
## 32 New York 4.00% 40 4.53% 4.88%
## 33 North Carolina 4.75% 35 2.25% 2.75%
## 34 North Dakota 5.00% 32 2.04% 3.50%
## 35 Ohio 5.75% 27 1.49% 2.25%
## 36 Oklahoma 4.50% 36 4.49% 7.00%
## 37 Oregon 0.00% 46 0.00% 0.00%
## 38 Pennsylvania 6.00% 17 0.34% 2.00%
## 39 Rhode Island 7.00% 2 0.00% 0.00%
## 40 South Carolina 6.00% 17 1.50% 3.00%
## 41 South Dakota 4.20% 39 1.91% 4.50%
## 42 Tennessee 7.00% 2 2.55% 2.75%
## 43 Texas 6.25% 13 1.95% 2.00%
## 44 Utah 6.10% 16 1.15% 4.20%
## 45 Vermont 6.00% 17 0.36% 1.00%
## 46 Virginia 5.30% 31 0.47% 2.70%
## 47 Washington 6.50% 9 2.88% 4.10%
## 48 West Virginia 6.00% 17 0.57% 1.00%
## 49 Wisconsin 5.00% 32 0.70% 2.90%
## 50 Wyoming 4.00% 40 1.44% 2.00%
The columns are:
state
: The name of the statestate_tax
: the sales tax percentage determined and
collected by the statestate_rank
: the rank of the state’s portion of the
sales taxavg_local_tax
: The average sales tax levied by
counties, towns, and cities (doesn’t count the state portion of the
sales tax)max_local_tax
: The maximum sales tax levied by a local
area (state sales tax not included)Create the graph seen in Brightspace. The graph displays the average
combined tax: state_tax
+ avg_local_tax
Hint: The csv file contains the percentage sign, which is why R reads in it as a character instead of a numeric type column. To easily extract the number from a character, look back at the dumbbell plot for house prices.