The first step I took in coding for this project was to load the
appropriate packages that would be used. I then wrote the
read_storm_disaster function that takes a user-specified
file name (the appropriate year for the data), and which properly parses
different columns to the appropriate type. This function also modifies
the “Name” column, and adds the “Year” and “Duration” columns. The
read_storm_disaster function is then input in a map
function that applies it to all of the .csv files within the data folder
for this project, also binding them as rows. The resulting data is saved
as the storm_data.csv. Using this dataset, I created the bar graph for
disaster counts and disaster types by year. I then grouped the data by
year and summarized the total average cost of events per year, and
created a line plot using this data. I then added interactive elements
to the bar graph, and added an interactive data table to complement the
line graph.
Use the table below to filter by Year, Disaster type, Deaths, and Duration to see associated combined cost.