The goal of this analysis is to explore data from the National Oceanic & Atmospheric Administration Storm Database to answer two questions:
Across the United States, which types of events are most harmful with respect to population health?
Across the United States, which types of events have the greatest economic consequences?
We found that Heat, Tornadoes, Flooding, Thunderstorms and Lightning were most harmful to population health and Floods, Droughts, Hurricanes(Typhoons) and Hail caused the greatest monetary damage.
We start processing by making sure the needed libraries are loaded. This chunk is not cached as some libraries need to be loaded everytime, otherwise they throw an error.
knitr::opts_chunk$set(echo = TRUE)
library(data.table)
library(lubridate)
library(reshape2)
library(ggplot2)
library(cowplot)
library(knitr)
Next, we read in the data. No pre-processing is done, the data is downloaded as is. This code chunk is cached due to the amount of time it takes to download the data and then to read it in. Further information on this data can be found here and here.
temp <- tempfile()
download.file("https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2", temp)
storm.data <- as.data.table(read.csv(temp))
unlink(temp)
Finally, we start our cleaning. The column names are converted to proper column names, all uppercase, no whitespace and no special characters. From there, the majority of the cleaning is dealing with the ‘EVTYPE’ column. There are only supposed to be 48 event types, but we found that there were over 1000 unique entries into the ‘EVTYPE’ column. Most of the entries are handled with gsub(), but a number of entries had to be manually updated. This was due to the ‘EVTYPE’ being an ambiguous entry (e.g. “other” or “summary). We also had to convert the ‘PROPDMGEXP’ and ‘CROPDMGEXP’ variables to their numeric values in accordance with this document.
From there, we converted the ‘BGN_DATE’ column to the ‘Date’ class, and proceeded to breakout the data as needed for Fatalities, Injuries, Property Damage and Crop Damage. Of note, the data is subsetted to only include data from 01 January, 1993 onward. This was done because prior to 1993, only a single event, tornadoes, was recorded.
##These first few lines setup the column names to be in proper format
colnames(storm.data) <- make.names(colnames(storm.data))
storm.data$BGN_DATE <- mdy_hms(storm.data$BGN_DATE)
storm.data$EVTYPE <- toupper(make.names(storm.data$EVTYPE))
storm.data$EVTYPE <- gsub("\\.+", "\\.", storm.data$EVTYPE)
storm.data$EVTYPE <- gsub("\\.$", "", storm.data$EVTYPE)
##The next 180 lines are to clean up the 1000+ unique entries in the 'EVTYPE' column. The majority of the cleaning is done using the gsub() function. But there were numerous entries that were ambigous in nature (e.g. "other" or "summary"). These observations had to be looked at individually and, in most cases, be updated one by one. The 'PROPDMGEXP' and 'CROPDMGEXP' columns had to be converted to their numeric values. There were ten observations, that upon review, were blank, containing no discernable information as to what the event was. These were marked "NA".
storm.data$EVTYPE <- gsub("astro.+", "ASTRONOMICAL.LOW.TIDE", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("blow\\.out.+", "ASTRONOMICAL.LOW.TIDE", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("astro.+", "ASTRONOMICAL.LOW.TIDE", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("blow\\.out.+", "ASTRONOMICAL.LOW.TIDE", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*ava.*", "AVALANCHE", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*blizz.*", "BLIZZARD", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*sli.*", "DEBRIS.FLOW", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(dense.fog|fog|patchy\\.dense\\.fog|.*fog\\.and.*)", "DENSE.FOG",
storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(freezing\\.dense\\.fog|ice\\.dense\\.fog)", "FREEZING.FOG", storm.data$EVTYPE, ignore.case= TRUE)
storm.data$EVTYPE <- gsub(".*smo.*", "DENSE.SMOKE", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(.*drou.*|below\\.normal\\.prec.*|.*dri.*)", "DROUGHT", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*dev.*", "DUST.DEVIL", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(.*dust$|.*dust\\.st.*|duststorm)", "DUST.STORM", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(excessively\\.dry|record\\.heat.*|record\\.excessive\\.heat|extreme\\.heat|^excessive$)", "EXCESSIVE.HEAT", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(coastal|cstl|tidal).*", "COASTAL.FD", storm.data$EVTYPE, ignore.case = TRUE) ## Done so not to get picked up with flood
storm.data$EVTYPE <- gsub(".*flash.*", "FLASH.FD", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(lake\\.flo.*|lakeshore.*)", "LAKESHORE.FD", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(flo|wet|urb|stre|dam).*", "FLOOD", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("COASTAL.FD", "COASTAL.FLOOD", storm.data$EVTYPE)
storm.data$EVTYPE <- gsub("FLASH.FD", "FLASH.FLOOD", storm.data$EVTYPE)
storm.data$EVTYPE <- gsub("LAKESHORE.FD", "LAKESHORE.FLOOD", storm.data$EVTYPE)
storm.data$EVTYPE <- gsub(".*(clo|fun).*", "FUNNEL.CLOUD", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(freezing\\.dense\\.fog|ice\\.dense\\.fog)", "FZ.FOG", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(fro|fre).*", "FROST.FREEZE", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("FZ\\.FOG", "FREEZING.FOG", storm.data$EVTYPE)
storm.data$EVTYPE <- gsub("marine\\.hail", "MARINE.HL", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*hail.*", "HAIL", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("marine\\.hl", "MARINE.HAIL", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(^heat.*|^high$|.*high\\.temp.*|record\\.high|.*warm.*|.*hot.*)", "HEAT", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(sle|freezing\\.rain).*", "SLEET", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(rain|prec|shower).*", "HEAVY.RAIN", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(surf|swell).*", "HIGH.SURF", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(hurr|typ).*", "HURRICANE.(TYPHOON)", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*ice.*", "ICE.STORM", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*lake\\..*", "LAKE.EFFECT.SN", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(sno|glaze).*", "HEAVY.SNOW", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("LAKE.EFFECT.SN", "LAKE.EFFECT.SNOW", storm.data$EVTYPE)
storm.data$EVTYPE <- gsub(".*(light|lign|red).*", "LIGHTNING", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("marine\\.hail", "MARINE.HL", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*hail.*", "HAIL", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("marine.hl", "MARINE.HAIL", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*rip.*", "RIP.CURRENT", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(.*(wav|surg).*|high\\.seas|high\\.surf|high\\.swells|high\\.tides|high\\.water|high\\.waves)", "STORM.SURGE.TIDE", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*torn.*", "TORNADO", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*tropical\\.s.*", "TROPICAL.STORM", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(volc|vog).*", "VOLCANIC.ASH", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*spout.*", "WATERSPOUT", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*fire.*", "WILDFIRE", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*winter.s.*", "WINTER.STORM", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(monthly|winter\\.m|winter\\.w|wintery|wintry|low\\.temp|record\\.low).*", "WINTER.WEATHER", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(.*sea.*|marine\\.(thunder|tstm)).*", "MARINE.TD.WIND", storm.data$EVTYPE,
ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(drow|ris|met|thund|tstm|tund|thu|storm\\.force|apa|summ).*", "THUNDERSTORM.WIND", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("MARINE.TD.WIND", "MARINE.THUNDERSTORM.WIND", storm.data$EVTYPE)
storm.data$EVTYPE <- gsub(".*(hyp|ext|record\\.col|excessive\\.co).*", "EXTREME.CWC", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*(col|chi|cool).*", "COLD.CHILL", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(.*abno.*|^very.*|^mild.*|wnd|.*wd.*|micro.*|non\\.sev.*|wake\\.low.*|^winds$|down.*|dry.*|grad.*|gus.*|^wind$|whirlwind|x\\.wind|^wind.*|high\\.wind.*)",
"HIGH.WD", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("(.*turb.*|strong\\.wind|strong\\.winds|strong\\.wind\\..*)", "STRONG.WIND", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub("COLD\\.CHILL", "COLD.WIND.CHILL", storm.data$EVTYPE)
storm.data$EVTYPE <- gsub("EXTREME\\.CWC", "EXTREME.COLD.WIND.CHILL", storm.data$EVTYPE)
storm.data$EVTYPE <- gsub("HIGH\\.WD", "HIGH.WIND", storm.data$EVTYPE)
storm.data$EVTYPE <- gsub(".*mis.*", "MARINE.STRONG.WIND", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$EVTYPE <- gsub(".*none.*", "NA", storm.data$EVTYPE, ignore.case = TRUE)
storm.data$PROPDMGEXP <- gsub("[0-9]", 10, storm.data$PROPDMGEXP)
storm.data$PROPDMGEXP <- gsub("\\+", 1, storm.data$PROPDMGEXP)
storm.data$PROPDMGEXP <- gsub("[Hh]", 100, storm.data$PROPDMGEXP)
storm.data$PROPDMGEXP <- gsub("[Kk]", 1000, storm.data$PROPDMGEXP)
storm.data$PROPDMGEXP <- gsub("[Mm]", 1000000, storm.data$PROPDMGEXP)
storm.data$PROPDMGEXP <- gsub("[Bb]", 1000000000, storm.data$PROPDMGEXP)
storm.data$PROPDMGEXP <- gsub("\\-", 0, storm.data$PROPDMGEXP)
storm.data$PROPDMGEXP <- gsub("\\?", 0, storm.data$PROPDMGEXP)
storm.data$PROPDMGEXP <- gsub("^$", 0, storm.data$PROPDMGEXP)
storm.data$CROPDMGEXP <- gsub("[0-9]", 10, storm.data$CROPDMGEXP)
storm.data$CROPDMGEXP <- gsub("\\+", 1, storm.data$CROPDMGEXP)
storm.data$CROPDMGEXP <- gsub("[Hh]", 100, storm.data$CROPDMGEXP)
storm.data$CROPDMGEXP <- gsub("[Kk]", 1000, storm.data$CROPDMGEXP)
storm.data$CROPDMGEXP <- gsub("[Mm]", 1000000, storm.data$CROPDMGEXP)
storm.data$CROPDMGEXP <- gsub("[Bb]", 1000000000, storm.data$CROPDMGEXP)
storm.data$CROPDMGEXP <- gsub("\\-", 0, storm.data$CROPDMGEXP)
storm.data$CROPDMGEXP <- gsub("\\?", 0, storm.data$CROPDMGEXP)
storm.data$CROPDMGEXP <- gsub("^$", 0, storm.data$CROPDMGEXP)
storm.data$EVTYPE[217832] <- "WINTER.WEATHER"
storm.data$EVTYPE[266115] <- "WINTER.WEATHER"
storm.data$EVTYPE[266154] <- "HEAT"
storm.data$EVTYPE[266157] <- "HEAT"
storm.data$EVTYPE[278255:278257] <- "WINTER.WEATHER"
storm.data$EVTYPE[278260:278263] <- "HEAT"
storm.data$EVTYPE[278269] <- "HEAT"
storm.data$EVTYPE[278352] <- "WINTER.WEATHER"
storm.data$EVTYPE[295048] <- "HEAT"
storm.data$EVTYPE[331277] <- "HEAT"
storm.data$EVTYPE[344707:344708] <- "HEAT"
storm.data$EVTYPE[376468:376470] <- "HEAT"
storm.data$EVTYPE[249540:249548] <- "HEAT"
storm.data$EVTYPE[249552:249566] <- "HEAT"
storm.data$EVTYPE[249568:249571] <- "HEAT"
storm.data$EVTYPE[249577:249578] <- "HEAT"
storm.data$EVTYPE[249580:249581] <- "HEAT"
storm.data$EVTYPE[249586:249587] <- "WINTER.WEATHER"
storm.data$EVTYPE[249589] <- "HEAT"
storm.data$EVTYPE[249595] <- "HEAT"
storm.data$EVTYPE[249601] <- "HEAT"
storm.data$EVTYPE[249604] <- "HEAT"
storm.data$EVTYPE[249606] <- "WINTER.WEATHER"
storm.data$EVTYPE[249610] <- "WINTER.WEATHER"
storm.data$EVTYPE[249613:249614] <- "HEAT"
storm.data$EVTYPE[281870] <- "HEAT"
storm.data$EVTYPE[219046] <- "WINTER.WEATHER"
storm.data$EVTYPE[230957] <- "HEAVY.SNOW"
storm.data$EVTYPE[230958] <- "WINTER.WEATHER"
storm.data$EVTYPE[254034] <- "FROST.FREEZE"
storm.data$EVTYPE[268029] <- "FROST.FREEZE"
storm.data$EVTYPE[273550] <- "FROST.FREEZE"
storm.data$EVTYPE[296007:296011] <- "HEAVY.SNOW"
storm.data$EVTYPE[297297] <- "FREEZING.FOG"
storm.data$EVTYPE[298054] <- "WINTER.STORM"
storm.data$EVTYPE[329387] <- "WINTER.WEATHER"
storm.data$EVTYPE[329389] <- "WINTER.WEATHER"
storm.data$EVTYPE[329394] <- "WINTER.WEATHER"
storm.data$EVTYPE[330549] <- "WINTER.WEATHER"
storm.data$EVTYPE[330555] <- "WINTER.WEATHER"
storm.data$EVTYPE[347498] <- "WINTER.WEATHER"
storm.data$EVTYPE[347701] <- "WINTER.WEATHER"
storm.data$EVTYPE[347711] <- "WINTER.WEATHER"
storm.data$EVTYPE[363595] <- "WINTER.WEATHER"
storm.data$EVTYPE[363618:363619] <- "WINTER.WEATHER"
storm.data$EVTYPE[378738] <- "WINTER.STORM"
storm.data$EVTYPE[378746] <- "WINTER.WEATHER"
storm.data$EVTYPE[401092] <- "WINTER.WEATHER"
storm.data$EVTYPE[469621] <- "FROST.FREEZE"
storm.data$EVTYPE[469625] <- "FROST.FREEZE"
storm.data$EVTYPE[469643] <- "FROST.FREEZE"
storm.data$EVTYPE[474671] <- "FROST.FREEZE"
storm.data$EVTYPE[219058] <- "HIGH.WIND"
storm.data$EVTYPE[219078] <- "SLEET"
storm.data$EVTYPE[219102] <- "SLEET"
storm.data$EVTYPE[244034] <- "SLEET"
storm.data$EVTYPE[244071] <- "SLEET"
storm.data$EVTYPE[244097] <- "HEAVY.SNOW"
storm.data$EVTYPE[253531] <- "HIGH.WIND"
storm.data$EVTYPE[312547] <- "HIGH.SURF"
storm.data$EVTYPE[359347] <- "HIGH.SURF"
storm.data$EVTYPE[435864] <- "STRONG.WIND"
storm.data$EVTYPE[217959] <- "DUST.DEVIL"
storm.data$EVTYPE[249470] <- "HEAVY.SNOW"
storm.data$EVTYPE[267121] <- "HEAVY.SNOW"
storm.data$EVTYPE[272928] <- "HEAVY.SNOW"
storm.data$EVTYPE[283221] <- "HIGH.WIND"
storm.data$EVTYPE[283270] <- "STRONG.WIND"
storm.data$EVTYPE[296061] <- "DUST.DEVIL"
storm.data$EVTYPE[296122] <- "DUST.DEVIL"
storm.data$EVTYPE[298603:298632] <- "HEAVY.RAIN"
storm.data$EVTYPE[308653] <- "BLIZZARD"
storm.data$EVTYPE[312860] <- "DUST.DEVIL"
storm.data$EVTYPE[350419] <- "STRONG.WIND"
storm.data$EVTYPE[350534] <- "STORM.SURGE.TIDE"
storm.data$EVTYPE[357396] <- "THUNDERSTORM.WIND"
storm.data$EVTYPE[357404:357406] <- "STRONG.WIND"
storm.data$EVTYPE[357719] <- "HIGH.WIND"
storm.data$EVTYPE[378699] <- "HEAT"
storm.data$EVTYPE[381907] <- "LIGHTNING"
storm.data$EVTYPE[398543] <- "LIGHTNING"
storm.data$EVTYPE[399112] <- "DUST.DEVIL"
storm.data$EVTYPE[435359] <- "DUST.DEVIL"
storm.data$EVTYPE[398631] <- "HEAVY.RAIN"
storm.data$EVTYPE[259966] <- "STORM.SURGE.TIDE"
storm.data$EVTYPE[251348] <- "STORM.SURGE.TIDE"
storm.data$EVTYPE[278353] <- "NA"
storm.data$EVTYPE[219016] <- "NA"
storm.data$EVTYPE[219054] <- "NA"
storm.data$EVTYPE[219057] <- "NA"
storm.data$EVTYPE[244050] <- "NA"
storm.data$EVTYPE[227319] <- "NA"
storm.data$EVTYPE[231124] <- "NA"
storm.data$EVTYPE[246124] <- "NA"
storm.data$EVTYPE[271602] <- "NA"
storm.data$EVTYPE[246839] <- "NA"
##Subset out data from 1993 onward
storm.data <- subset(storm.data, storm.data$BGN_DATE > as.Date("1993-01-01"))
##Create variables for fatalities
fat.Storm <- storm.data[, c("FATALITIES", "BGN_DATE", "EVTYPE")]
fat.Storm$BGN_DATE <- year(fat.Storm$BGN_DATE)
fat.Storm <- subset(fat.Storm, fat.Storm$FATALITIES != 0)
fat.Storm.tot <- fat.Storm[, list(FAT.SUM = sum(FATALITIES)), by = "EVTYPE"]
setorder(fat.Storm.tot, -FAT.SUM)
fat.Storm.tot$PERCENTAGE <- round(prop.table(fat.Storm.tot$FAT.SUM)*100, digits = 2)
##Create variables for injuries
inj.Storm <- storm.data[, c("INJURIES", "BGN_DATE", "EVTYPE")]
inj.Storm$BGN_DATE <- year(inj.Storm$BGN_DATE)
inj.Storm <- subset(inj.Storm, inj.Storm$INJURIES != 0)
inj.Storm.tot <- inj.Storm[, list(INJ.SUM = sum(INJURIES)), by = "EVTYPE"]
setorder(inj.Storm.tot, -INJ.SUM)
inj.Storm.tot$PERCENTAGE <- round(prop.table(inj.Storm.tot$INJ.SUM)*100, digits = 2)
##Create variables for property damage
prop.Storm <- storm.data[, c("PROPDMG", "PROPDMGEXP", "BGN_DATE", "EVTYPE")]
prop.Storm$BGN_DATE <- year(prop.Storm$BGN_DATE)
prop.Storm$PROPDMGEXP <- as.numeric(prop.Storm$PROPDMGEXP)
prop.Storm <- subset(prop.Storm, prop.Storm$PROPDMG != 0)
prop.Storm.tot <- prop.Storm[, list(PROP.SUM = sum(PROPDMG * PROPDMGEXP)/1000000000), by = "EVTYPE"]
prop.Storm.tot$PROP.SUM <- round(prop.Storm.tot$PROP.SUM, digits = 2)
setorder(prop.Storm.tot, -PROP.SUM)
prop.Storm.tot$PERCENTAGE <- round(prop.table(prop.Storm.tot$PROP.SUM)*100, digits = 2)
##Create variables for crop damage
crop.Storm <- storm.data[, c("CROPDMG", "CROPDMGEXP", "BGN_DATE", "EVTYPE")]
crop.Storm$BGN_DATE <- year(crop.Storm$BGN_DATE)
crop.Storm$CROPDMGEXP <- as.numeric(crop.Storm$CROPDMGEXP)
crop.Storm <- subset(crop.Storm, crop.Storm$CROPDMG != 0)
crop.Storm.tot <- crop.Storm[, list(CROP.SUM = sum(CROPDMG * CROPDMGEXP)/1000000000), by = "EVTYPE"]
crop.Storm.tot$CROP.SUM <- round(crop.Storm.tot$CROP.SUM, digits = 2)
setorder(crop.Storm.tot, - CROP.SUM)
crop.Storm.tot$PERCENTAGE <- round(prop.table(crop.Storm.tot$CROP.SUM)*100, digits = 2)
The code chunks and plots below show the relationships between fatalities and injuries by event type and then property and crop damage by event type.
The first figure displays the amount of fatalities and injuries by event type over the course of 18 years (1993 - 2011).
fat <- ggplot(fat.Storm.tot, aes(EVTYPE, FAT.SUM)) + geom_col(aes(fill = EVTYPE)) + coord_flip() +
theme_bw() + theme(legend.position = "none", axis.title.x=element_blank(), plot.title = element_text(hjust = 0.5)) + labs(x = "Fatality Event Type", title = "Comparison of Fatalities and Injuries By Event Type")
inj <- ggplot(inj.Storm.tot, aes(EVTYPE, INJ.SUM)) + geom_col(aes(fill = EVTYPE)) + coord_flip() +
theme_bw()+ theme(legend.position = "none") + labs(x = "Injury Event Type", y = "Number of Occurences")
plot_grid(fat, inj, ncol = 1, axis = "1", align = "v")
The table below shows the top five fatal events, the total number of fatalities per event and their respective percentages compared to the total amount of fatalities:
| Event | Number of Fatalities Per Event | Percentage of Total Fatalities |
|---|---|---|
| EXCESSIVE.HEAT | 2018 | 18.57 |
| TORNADO | 1624 | 14.95 |
| HEAT | 1154 | 10.62 |
| FLASH.FLOOD | 1035 | 9.53 |
| LIGHTNING | 817 | 7.52 |
The next table shows the same information as above, but for injuries:
| Event | Number of Injuries Per Event | Percentage of Total Injuries |
|---|---|---|
| TORNADO | 23371 | 33.99 |
| FLOOD | 6935 | 10.09 |
| EXCESSIVE.HEAT | 6730 | 9.79 |
| THUNDERSTORM.WIND | 6087 | 8.85 |
| LIGHTNING | 5232 | 7.61 |
As we can see, fatalities and injuries share four of their top five events. As expected, there are far more injuries then fatalities per event and overall. Of interest are the percentages. For fatalities, the top three events are within approximately four percent of each other with each subsequent event being within one to two percent of the previous event. Whereas with injuries, tornadoes make up 34% of all injuries and there is a 23% drop-off to the second event.
The second figure displays the cost of property and crop damage incurred by the various event types:
prop <- ggplot(prop.Storm.tot, aes(EVTYPE, PROP.SUM)) + geom_col(aes(fill = EVTYPE)) + coord_flip() +
theme_bw() + theme(legend.position = "none", axis.title.x = element_blank(),
plot.title = element_text(hjust = 0.5)) + labs(x = "Property Damage Event Type",
title = "Comparison of Property and Crop Damage Cost By Event Type")
crop <- ggplot(crop.Storm.tot, aes(EVTYPE, CROP.SUM)) + geom_col(aes(fill = EVTYPE)) + coord_flip() +
theme_bw() + theme(legend.position = "none") + labs(x = "Crop Damage Event Type", y = "Cost of Damage (in billions, USD)")
plot_grid(prop, crop, ncol = 1, axis = "1", align = "v")
Our next two tables break out the cost of damage incurred to both property and crops:
| Event | Cost of Property Damage Per Event (in billions, USD) | Percentage of Total Property Damage |
|---|---|---|
| FLOOD | 150.56 | 37.95 |
| HURRICANE.(TYPHOON) | 85.36 | 21.52 |
| STORM.SURGE.TIDE | 48.07 | 12.12 |
| TORNADO | 26.39 | 6.65 |
| HAIL | 17.62 | 4.44 |
| Event | Cost of Crop Damage Per Event (in billions, USD) | Percentage of Total Crop Damage |
|---|---|---|
| DROUGHT | 13.97 | 28.46 |
| FLOOD | 11.39 | 23.20 |
| HURRICANE.(TYPHOON) | 5.52 | 11.24 |
| ICE.STORM | 5.02 | 10.23 |
| HAIL | 3.11 | 6.34 |
Similar to what we saw previously with fatalities and injuries, property and crop damage share three of their top five events. Property damage had a sharper drop off from the top event to its second event then with crop damage. Both had a similar drop off from their second to third events. With property damage, the first three events make up ~72% of the total damage, with events 25-46 making up 0%. For crop damage, the top four events made up ~73% of total damage, but only the last 4 events made up 0%.