Gun Laws by State

how well do they protect from gun violence?

Libraries and data import

The first task that I had to complete for this analysis was finding data on gun laws. Luckily I had help from my professor and he was able to send me a few data sets that were already clean and easy to work worth. All I had to do was import them into tableau and into R. This way I was able to create graphs and tables based on the information in the data sets.

library(tidyverse)
## Warning in system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE):
## running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/
## modules/R_de.so'' had status 1
library(readxl)
gun_related_deaths_by_state <- read_excel("/Volumes/Sam's SSD/Geospatial Gun Laws/gun-related-deaths-by-state.xlsx")
firearms_data %>% 
  left_join(gun_related_deaths_by_state) -> combined

Combining Data Sets

Next I wanted all of the data in the same place. Instead of 3 different data sets I wanted all the information in one data set. I used left join function in order to join all the data into one big dataset which I named ‘combined’. Pretty much the same thing was done in tableau in order to make the next two chloropleth maps.

library(readxl)
Copy_of_gun_law_grades <- read_excel("/Volumes/Sam's SSD/Geospatial Gun Laws/Copy of gun_law_grades.xlsx")

combined %>% 
  left_join(Copy_of_gun_law_grades) -> combined
## Joining, by = "State"

Gun Laws Graded by State

This chloropleth map shows the grade given to each state based on how safe their gun laws are. The main aspect that catches the eye from this map is the amount of F’s given. A majority of states were graded at the F grade which means their gun laws are not adequite.

Conclusion

There are a lot of states that need to improve their gnu laws according to the grade map. There is however a large outlier. One state who graded pretty average but had an unique amount of gun-related deaths. From this I feel that a solid conclusion cant be made and more research into the outlier is necessary.