0. Synopsis:
This report analyzes the impact of the different weather events as registered in the U.S. National Oceanic and Atmospheric Administration’s (NOAA) hsitoric storm database. In particular two main impacts are tracked:
Human health impact, measured as number of overall fatalities registered as a direct consequence of the indicated events. Tornados show up here as a major threat for human integrity.
Economic impact, measured as the combined direct effects of property damages and crops damages.While floods and hurricanes stand as the top 2 combined economic impact it is remarkable the influence of droughts in crops.
1. Data Processing
Libraries:
Dplyr, Ggplot2, Knitr libraries are used in this analysis.
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)
library(knitr)
Loading and preprocessing the data.
noaa <- read.csv("repdata%2Fdata%2FStormData.csv")
Property damage is processed in order to show all ammounts in KUSD. Full impact is the result of adding up Property and Crops damage. Any data item on the ‘EXP’‘s columns different than K/k, M/m, B/b is taken as ’0’ (no relevant for the analysis).
resolveunits <- function (Dmg, DmgExp)
{
if (grepl("[Kk]", DmgExp))
return(Dmg)
else if (grepl("[Mm]", DmgExp))
return(Dmg*1000)
else if (grepl("[Bb]", DmgExp))
return(Dmg*1000000)
else
return(0)
}
noaa$PDMG <- mapply(resolveunits, noaa$PROPDMG, noaa$PROPDMGEXP)
noaa$CDMG <- mapply(resolveunits, noaa$CROPDMG, noaa$CROPDMGEXP)
noaa$TDMG <- noaa$PDMG + noaa$CDMG
2. Results
Human health damage
The 10 event types with more fatalities are selected here. Fatalities are considered the right criteria to measure human health damage. Table 1 below shows as well the injuries linked to each event type.
noaahlth <- noaa %>% group_by(EVTYPE) %>% summarize(FAT=sum(FATALITIES), INJ=sum(INJURIES)) %>% arrange(desc(FAT))
noaahlth <- noaahlth[1:10,]
Prepares the summarized data and plots it:
noaahlth$EVTYPE <- factor(noaahlth$EVTYPE, levels = noaahlth$EVTYPE[order(noaahlth$FAT, decreasing=TRUE)])
g <- ggplot(noaahlth, aes(x=EVTYPE, y=FAT)) +
theme_bw() +
geom_bar(size=0.8, colour="black", fill="blue", stat="identity") +
xlab("Event Type") +
ylab("Fatalities") +
ggtitle("NOAA: Events most harmful to population health") +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
theme(plot.title = element_text(hjust = 0.5))
print(g)

Following table (Table1) shows as well the injured individuals for each type of event above
names(noaahlth) <- c("Event Type","Fatalities","Injured")
kable(noaahlth)
| TORNADO |
5633 |
91346 |
| EXCESSIVE HEAT |
1903 |
6525 |
| FLASH FLOOD |
978 |
1777 |
| HEAT |
937 |
2100 |
| LIGHTNING |
816 |
5230 |
| TSTM WIND |
504 |
6957 |
| FLOOD |
470 |
6789 |
| RIP CURRENT |
368 |
232 |
| HIGH WIND |
248 |
1137 |
| AVALANCHE |
224 |
170 |
Economic damage
A Top 10 table of the event types with more econcomic damage is shown next. Property + Crops damage is considered the right criteria to measure economic damage, however a brief discussion on injured individuals follows.
noaadmg <- noaa %>%
group_by(EVTYPE) %>%
summarize(
PDMG=sum(PDMG),
CDMG=sum(CDMG),
TDMG=sum(TDMG)) %>%
arrange(desc(TDMG))
noaadmg <- noaadmg[1:10,]
Prepares the Top 10 Event/Fatalities summarized data and plots it.
noaadmg$EVTYPE <- factor(noaadmg$EVTYPE, levels = noaadmg$EVTYPE[order(noaadmg$TDMG, decreasing=TRUE)])
g <- ggplot(noaadmg, aes(x=EVTYPE, y=TDMG)) +
theme_bw() +
geom_bar(size=0.8, colour="black", fill="red",stat="identity") +
xlab("Event Type") +
ylab("Property & Crops damage in thousands of USD") +
ggtitle("NOAA: Events with greatest economic consequences (KUSD)") +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
theme(plot.title = element_text(hjust = 0.5))
print(g)

The following table (Table2) shows the direct property damage impact in USD of each type of event above.
names(noaadmg) <- c("Event Type","Property Damage (KUSD)", "Crops Damage (KUSD)", "Total Damage (KUSD)")
kable(noaadmg)
| FLOOD |
144657710 |
5661968.5 |
150319678 |
| HURRICANE/TYPHOON |
69305840 |
2607872.8 |
71913713 |
| TORNADO |
56937160 |
414953.1 |
57352114 |
| STORM SURGE |
43323536 |
5.0 |
43323541 |
| HAIL |
15732267 |
3025954.5 |
18758221 |
| FLASH FLOOD |
16140812 |
1421317.1 |
17562129 |
| DROUGHT |
1046106 |
13972566.0 |
15018672 |
| HURRICANE |
11868319 |
2741910.0 |
14610229 |
| RIVER FLOOD |
5118946 |
5029459.0 |
10148405 |
| ICE STORM |
3944928 |
5022113.5 |
8967041 |