This report mainly studied how storms impacted both public health and economic problems for communities and municipalities. The study found, Tornado, Excessive Heat, TSTM WIND are the most harmful with respect to population health, Tornado , FlASH FLOOD, TSTM WIND etc. have the greatest economic consequences. This study results may help to prioritize resources for different types of events in preparing for severe weather events.
After reading in the origin data, a new data set called “storm” was subset to keep only those usufull variables for later analysis.
wbh<-read.csv(bzfile("repdata-data-StormData.csv.bz2"))
storm<-wbh[,c("EVTYPE", 'FATALITIES', 'INJURIES', 'PROPDMG', 'CROPDMG')]
str(storm)
## 'data.frame': 902297 obs. of 5 variables:
## $ EVTYPE : Factor w/ 985 levels "?","ABNORMALLY DRY",..: 830 830 830 830 830 830 830 830 830 830 ...
## $ FATALITIES: num 0 0 0 0 0 0 0 0 1 0 ...
## $ INJURIES : num 15 0 2 2 2 6 1 0 14 0 ...
## $ PROPDMG : num 25 2.5 25 2.5 2.5 2.5 2.5 2.5 25 25 ...
## $ CROPDMG : num 0 0 0 0 0 0 0 0 0 0 ...
head(storm)
## EVTYPE FATALITIES INJURIES PROPDMG CROPDMG
## 1 TORNADO 0 15 25.0 0
## 2 TORNADO 0 0 2.5 0
## 3 TORNADO 0 2 25.0 0
## 4 TORNADO 0 2 2.5 0
## 5 TORNADO 0 2 2.5 0
## 6 TORNADO 0 6 2.5 0
#table(storm$EVTYPE)
require(lattice)
## Loading required package: lattice
fata<-tapply(storm$FATALITIES, storm$EVTYPE,sum, na.rm=TRUE)
Data<-fata[order(-fata)][1:10]
barchart(Data, xlab="Total Number", main="Total Number of Fatalities")
injury<-tapply(storm$INJURIES, storm$EVTYPE,sum, na.rm=TRUE)
Data<-injury[order(-injury)][1:10]
barchart(Data, xlab="Total Number", main="Total Number of Injuries")
prop<-tapply(storm$PROPDMG, storm$EVTYPE,sum, na.rm=TRUE)
Num1<-prop[order(-prop)][1:10]
Num1
## TORNADO FLASH FLOOD TSTM WIND
## 3212258 1420125 1335966
## FLOOD THUNDERSTORM WIND HAIL
## 899938 876844 688693
## LIGHTNING THUNDERSTORM WINDS HIGH WIND
## 603352 446293 324732
## WINTER STORM
## 132721
crop<-tapply(storm$CROPDMG, storm$EVTYPE,sum, na.rm=TRUE)
Num2<-crop[order(-crop)][1:10]
Num2
## HAIL FLASH FLOOD FLOOD
## 579596 179200 168038
## TSTM WIND TORNADO THUNDERSTORM WIND
## 109203 100019 66791
## DROUGHT THUNDERSTORM WINDS HIGH WIND
## 33899 18685 17283
## HEAVY RAIN
## 11123
tot<-tapply(storm$PROPDMG+storm$CROPDMG, storm$EVTYPE,sum, na.rm=TRUE)
Tot=tot[order(-tot)][1:10]
barchart(Tot, xlab="Total Damages(Properties + Crops)", main="Total Damage(Properties + Crops)")
In this study, the top ten types of storms which cause the most fatalities and injuries, and the top ten types of storms that brought most properties and crops damage were given. Generally speaking, TORNADO, FLOOD, TSTM WIND etc. contribute the most in both situations.