This report explores the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database to assess the impact of severe weather events on population health and the economy across the United States. The data span from 1950 to 2011 and include information on fatalities, injuries, property damage, and crop damage. This analysis identifies the types of events that are most harmful to population health and have the greatest economic consequences. The findings are intended to support decision-makers in allocating resources for disaster preparedness.
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)
install.packages("readr")
## package 'readr' successfully unpacked and MD5 sums checked
##
## The downloaded binary packages are in
## C:\Users\Mensch\AppData\Local\Temp\RtmpkFe1nn\downloaded_packages
library(readr)
storm_data <- read.csv("repdata_data_StormData.csv", stringsAsFactors = FALSE)
storm_data <- storm_data %>%
select(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP)
exp_convert <- function(exp) {
if (exp %in% c("h", "H")) return(100)
else if (exp %in% c("k", "K")) return(1000)
else if (exp %in% c("m", "M")) return(1e6)
else if (exp %in% c("b", "B")) return(1e9)
else return(1)
}
storm_data$PROPDMGEXP <- sapply(storm_data$PROPDMGEXP, exp_convert)
storm_data$CROPDMGEXP <- sapply(storm_data$CROPDMGEXP, exp_convert)
storm_data <- storm_data %>%
mutate(property_damage = PROPDMG * PROPDMGEXP,
crop_damage = CROPDMG * CROPDMGEXP)
health_impact <- storm_data %>%
group_by(EVTYPE) %>%
summarise(Fatalities = sum(FATALITIES, na.rm = TRUE),
Injuries = sum(INJURIES, na.rm = TRUE)) %>%
mutate(Total = Fatalities + Injuries) %>%
arrange(desc(Total)) %>%
head(10)
ggplot(health_impact, aes(x = reorder(EVTYPE, Total), y = Total)) +
geom_col(fill = "firebrick") +
coord_flip() +
labs(title = "Top 10 Most Harmful Weather Events to Population Health",
x = "Event Type", y = "Total (Fatalities + Injuries)")
economic_impact <- storm_data %>%
group_by(EVTYPE) %>%
summarise(Property = sum(property_damage, na.rm = TRUE),
Crop = sum(crop_damage, na.rm = TRUE)) %>%
mutate(Total = Property + Crop) %>%
arrange(desc(Total)) %>%
head(10)
ggplot(economic_impact, aes(x = reorder(EVTYPE, Total), y = Total / 1e9)) +
geom_col(fill = "darkblue") +
coord_flip() +
labs(title = "Top 10 Weather Events by Economic Damage",
x = "Event Type", y = "Total Damage (Billion USD)")
Because they cause the greatest injuries and fatalities, tornadoes are the most detrimental natural disasters to public health. Hurricanes, droughts, and floods cause the most financial damage from an economic perspective. These findings give emergency planners and policymakers valuable information to help them concentrate their resources on reducing the impact of these severe weather occurrences.