This analysis explores data from the NOAA Storm Database to identify severe weather events that are most harmful to human health and those causing the greatest economic damage. Tornadoes cause the highest fatalities and injuries, while floods result in substantial property damage. The data is cleaned, transformed, and summarized to provide insights into these impacts.
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.4.3
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.4.3
setwd("C:/Users/Aaditya Sadangi/Downloads")
storm_data <- read.csv("repdata_data_StormData.csv.bz2")
processed_data <- storm_data %>%
select(EVTYPE, FATALITIES, INJURIES, PROPDMG, CROPDMG) %>%
group_by(EVTYPE) %>%
summarise(
Total_Fatalities = sum(FATALITIES, na.rm = TRUE),
Total_Injuries = sum(INJURIES, na.rm = TRUE),
Total_Property_Damage = sum(PROPDMG, na.rm = TRUE),
Total_Crop_Damage = sum(CROPDMG, na.rm = TRUE)
) %>%
mutate(Total_Economic_Damage = Total_Property_Damage + Total_Crop_Damage) %>%
arrange(desc(Total_Fatalities))
###Top 10 events by fatalities
top_fatalities <- processed_data %>%
top_n(10, Total_Fatalities)
###Plot
ggplot(top_fatalities, aes(x = reorder(EVTYPE, -Total_Fatalities), y = Total_Fatalities)) +
geom_bar(stat = "identity", fill = "steelblue") +
coord_flip() +
labs(title = "Top 10 Events Most Harmful to Population Health",
x = "Event Type",
y = "Total Fatalities")
###Top 10 events by economic damage
top_economic_damage <- processed_data %>%
top_n(10, Total_Economic_Damage)
###Plot
ggplot(top_economic_damage, aes(x = reorder(EVTYPE, -Total_Economic_Damage), y = Total_Economic_Damage)) +
geom_bar(stat = "identity", fill = "darkgreen") +
coord_flip() +
labs(title = "Top 10 Events with Greatest Economic Consequences",
x = "Event Type",
y = "Total Economic Damage")
This analysis demonstrates that tornadoes are the most harmful weather events to population health due to their high fatality and injury rates. On the other hand, floods have the greatest economic impact due to extensive property damage. These findings highlight the importance of disaster preparedness for minimizing human casualties and financial losses.