Synopsis

This analysis explores the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database. It identifies the most harmful weather events in terms of population health and economic impact.

Data Processing

Load Required Libraries

library(dplyr)
## 
## 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)

Load the Data

data <- read.csv("repdata_data_StormData.csv")

Data Cleaning and Processing

  • Convert event types to uppercase for consistency.
  • Filter relevant columns: EVTYPE, FATALITIES, INJURIES, PROPDMG, and CROPDMG.
  • Aggregate data by event type.
data <- data %>%
  select(EVTYPE, FATALITIES, INJURIES, PROPDMG, CROPDMG) %>%
  mutate(EVTYPE = toupper(EVTYPE))

Results

Most Harmful Events for Population Health

health_impact <- data %>%
  group_by(EVTYPE) %>%
  summarise(Total_Fatalities = sum(FATALITIES, na.rm = TRUE),
            Total_Injuries = sum(INJURIES, na.rm = TRUE)) %>%
  arrange(desc(Total_Fatalities + Total_Injuries)) %>%
  head(10)

ggplot(health_impact, aes(x = reorder(EVTYPE, -(Total_Fatalities + Total_Injuries)), 
                          y = Total_Fatalities + Total_Injuries)) +
  geom_bar(stat = "identity", fill = "red") +
  coord_flip() +
  labs(title = "Top 10 Weather Events Affecting Population Health", 
       x = "Event Type", 
       y = "Total Fatalities and Injuries")

Weather Events with Greatest Economic Impact

economic_impact <- data %>%
  group_by(EVTYPE) %>%
  summarise(Total_Damage = sum(PROPDMG + CROPDMG, na.rm = TRUE)) %>%
  arrange(desc(Total_Damage)) %>%
  head(10)

ggplot(economic_impact, aes(x = reorder(EVTYPE, -Total_Damage), y = Total_Damage)) +
  geom_bar(stat = "identity", fill = "blue") +
  coord_flip() +
  labs(title = "Top 10 Weather Events with Economic Impact", 
       x = "Event Type", 
       y = "Total Property and Crop Damage")

Conclusion

This analysis highlights the most hazardous weather events in terms of human health and economic consequences. Tornadoes appear to be the most harmful to human life, while floods and hurricanes cause significant economic losses.