Synopsis
Storms and other severe weather events can influence both population health and economic problems for communities and municipalities,resulting in fatalities,injuries and property damage.This project explores the U.S. NOAA storm database.The events recorded in this database start in the year 1950 and end in 2011.Analysis of the dataset tells that TORNADO is the most harmful severe weather event to population health and FLOOD causes greatest economic consequences.
Data Processing
setwd("C:\\Users\\lenovo\\Desktop")
stormdata <- read.csv(bzfile("repdata-data-StormData.csv.bz2"))
stormdata$Population <- stormdata$FATALITIES + stormdata$INJURIES
Population <- aggregate(stormdata$Population, by = list(stormdata$EVTYPE), sum)
colnames(Population) <- c("EVTYPE", "population")
poporder <- order(Population$population, decreasing = TRUE)[1:10]
pop <- Population[poporder, ]
barplot(pop[, 2], main = "Figure 1: Top 10 Events Harmful to Population Health",
ylab = "FATALITIES and INJURIES")
text(seq(0.7, 12, by = 1.2), y = -7000, labels = pop[, 1], srt = 45, pos = 1,
xpd = TRUE, cex = 0.7)
Figure 1 shows top 10 types of severe weather events most harmful with respect to population health and TORNADO is the most harmful one far more than the rest.
econ <- stormdata[, c(8, 25:28)]
econ1 <- econ[econ$PROPDMG != 0 | econ$CROPDMG != 0, ]
levels(econ1$PROPDMGEXP) <- list(`0` = c("", "-", "?", "+"), `1` = "0", `10` = "1",
`100` = c("2", "H", "h"), `1000` = c("3", "K"), `10000` = "4", `100000` = "5",
`1000000` = c("6", "m", "M"), `10000000` = "7", `100000000` = "8", `1000000000` = "B")
econ1$PROPDMGEXP <- as.numeric(as.character(econ1$PROPDMGEXP))
levels(econ1$CROPDMGEXP) <- list(`0` = c("", "?"), `1` = "0", `100` = "2", `1000` = c("k",
"K"), `1000000` = c("m", "M"), `1000000000` = "B")
econ1$CROPDMGEXP <- as.numeric(as.character(econ1$CROPDMGEXP))
econ1$economic <- econ1$PROPDMG * econ1$PROPDMGEXP + econ1$CROPDMG * econ1$CROPDMGEXP
econdmg <- aggregate(econ1$economic, by = list(econ1$EVTYPE), sum)
colnames(econdmg) <- c("EVTYPE", "economic")
econorder <- order(econdmg$economic, decreasing = TRUE)[1:10]
edmg <- econdmg[econorder, ]
barplot(edmg$economic/(1e+09), main = "Figure 2:Top 10 Events Harmful to Economics",
ylab = "Economic Damage (Billion Dollar)")
text(seq(0.7, 12, by = 1.2), y = -10, labels = edmg$EVTYPE, srt = 45, pos = 1,
xpd = TRUE, cex = 0.7)
Figure 2 shows top 10 types of events have the greatest economic consequences and FLOOD is the most harmful one leading to economic loss.
Results
Figure 1 shows top 10 types of severe weather events most harmful with respect to population health and TORNADO is the most harmful one far more than the rest.Figure 2 shows top 10 types of events have the greatest economic consequences and FLOOD is the most harmful one leading to economic loss.Preventing huge loss and damage is a key concern.