Portfolio 3
Visualizing United States Billion-Dollar Disaster Data from 1980-2024
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.