Looking at the data the numerous disaster event types have impacted states across the United States significantly. Below I took a look at the top 5 disaster event types for both the combination of fatalities and injuries as well as the property damage that caused its respective states incredible economic consequences.
The top 5 types of events that are the most harmful across the United States are Heavy surf and wind, Flood/Rain/Winds, Abnormal Warmth, High Winds, Record Cold/Frost.
data <- read.csv("repdata_data_StormData.csv")
hurtDF <- data.frame(
eventType <- unique(data[["EVTYPE"]]),
fatal_injur <- tapply(data[["FATALITIES"]], data[["EVTYPE"]], sum) + tapply(data[["INJURIES"]], data[["EVTYPE"]], sum)
)
colnames(hurtDF) <- c("Event Type", "Fatal_Injur")
hurtDFsorted <- hurtDF[order(-hurtDF[["Fatal_Injur"]]),]
hurtDFsorted <- head(hurtDFsorted,5)
barplot(hurtDFsorted[["Fatal_Injur"]], names.arg = hurtDFsorted[["Event Type"]],
col = "blue",
main = "Top Fatalities and Injuries per Event Type",
xlab = "Event Type",
ylab = "Fatalities / Injuries",
cex.names = 0.5)
The top 5 types of events that are the caused the highest economic damage across the United States are Heavy surf and wind, Heavy surf and wind, Microbust Winds, Abnormal Warmth, High Winds, Thunderstorm Wind (summary of June 19th). This was calculated looking at the property damage of each event type. The property damage denotes the amount of work that would be needed to be done by the state to be able to repair the damages to recover from the event.
econDF <- data.frame(
eventType <- unique(data[["EVTYPE"]]),
propDMG <- tapply(data[["PROPDMG"]], data[["EVTYPE"]], sum) + tapply(data[["INJURIES"]], data[["EVTYPE"]], sum)
)
colnames(econDF) <- c("Event Type", "Property DMG")
econDFsorted <- econDF[order(-econDF[["Property DMG"]]),]
econDFsorted <- head(econDFsorted,5)
barplot(econDFsorted[["Property DMG"]], names.arg = econDFsorted[["Event Type"]],
col = "red",
main = "Top Property Damage per Event Type",
xlab = "Event Type",
ylab = "Property Damage ($)",
cex.names = 0.5)
After analyzing the weather data on the different event types across the US, there was two event types that stuck out on both the fatalities/injuries graph and property damage graph. Heavy surf and wind appeared as number 1 on both lists and the Abnormal Warmth showed up as the third highest event on both graphs.