Synopsis

This report analyzes the NOAA Storm Database to identify which types of weather events are most harmful to population health and which have the greatest economic consequences. The analysis aggregates fatalities, injuries, and economic damages across event types. Results indicate that tornadoes are the most harmful to population health, while floods and storms contribute the most to economic damage.

Data Processing

library(dplyr)
## Warning: package 'dplyr' was built under R version 4.5.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.5.3
data <- read.csv("repdata_data_StormData.csv.bz2")

data$TOTAL_HARM <- data$FATALITIES + data$INJURIES
data$TOTAL_DAMAGE <- data$PROPDMG + data$CROPDMG

Results

Most Harmful Events to Population Health

harm_data <- data %>%
  group_by(EVTYPE) %>%
  summarise(total_harm = sum(TOTAL_HARM, na.rm = TRUE)) %>%
  arrange(desc(total_harm))

top_harm <- head(harm_data, 10)

ggplot(top_harm, aes(x = reorder(EVTYPE, total_harm), y = total_harm)) +
  geom_bar(stat = "identity") +
  coord_flip() +
  labs(title = "Top 10 Most Harmful Events",
       x = "Event Type",
       y = "Total Harm")

Events with Greatest Economic Consequences

damage_data <- data %>%
  group_by(EVTYPE) %>%
  summarise(total_damage = sum(TOTAL_DAMAGE, na.rm = TRUE)) %>%
  arrange(desc(total_damage))

top_damage <- head(damage_data, 10)

ggplot(top_damage, aes(x = reorder(EVTYPE, total_damage), y = total_damage)) +
  geom_bar(stat = "identity") +
  coord_flip() +
  labs(title = "Top 10 Events by Economic Damage",
       x = "Event Type",
       y = "Total Damage")