The goal of the analysis is to identify the most severe weather events with respsect to their impact on human health and economy in the US. The analysis is based on U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database which tracks characteristics of major storms and weather events in the United States, including when and where they occur, as well as estimates of any fatalities, injuries, and property damage. From this data follows that Tornado is most harmful weather event with respect to human health and Floods cause the greatest economic consequences.
storm <- read.csv("repdata-data-StormData.csv")
Converting begin date and damages numbers for the further calculations
storm$YEAR = strptime(storm$BGN_DATE, "%m/%d/%Y")$year + 1900
storm$PROPDMG_SUM = ifelse(storm$PROPDMGEXP == "K", storm$PROPDMG * 1000,
ifelse(storm$PROPDMGEXP == "M", storm$PROPDMG * 1000000,
ifelse(storm$PROPDMGEXP == "B", storm$PROPDMG * 1000000000, 0)))
storm$CROPDMG_SUM = ifelse(storm$CROPDMGEXP == "K", storm$CROPDMG * 1000,
ifelse(storm$CROPDMGEXP == "M", storm$CROPDMG * 1000000,
ifelse(storm$CROPDMGEXP == "B", storm$CROPDMG * 1000000000, 0)))
Calculating total number of events types tracked in particular year
storm_evtype_year <- rbind(by(storm, storm$YEAR, function(group) {length(unique(group$EVTYPE))}))
barplot(storm_evtype_year)
According to the plot it appears that more or less stable list of event started tracking since 2003, approximately 45 each year
storm_evtype_year[, 54:62]
## 2003 2004 2005 2006 2007 2008 2009 2010 2011
## 51 38 46 50 46 46 46 46 46
And 71 at all
length(unique(storm$EVTYPE[storm$YEAR >= 2003]))
## [1] 71
So we limit initial dataset with records since 2003
storm_year_2003_2011 <- storm[storm$YEAR >= 2003, ]
Identifing most harmfull events
storm_health <- aggregate(cbind(FATALITIES, INJURIES) ~ EVTYPE, storm_year_2003_2011, sum)
storm_economy <- aggregate(cbind(PROPDMG_SUM, CROPDMG_SUM) ~ EVTYPE, storm_year_2003_2011, sum)
Most harmful human health events
head(storm_health[order(-(storm_health$INJURIES + storm_health$FATALITIES)), ], 5)
## EVTYPE FATALITIES INJURIES
## 56 TORNADO 1057 12620
## 15 EXCESSIVE HEAT 524 2419
## 39 LIGHTNING 319 1994
## 55 THUNDERSTORM WIND 130 1400
## 27 HEAT 229 1222
Most harmful economy events
head(storm_economy[order(-(storm_economy$PROPDMG_SUM + storm_economy$CROPDMG_SUM)), ], 5)
## EVTYPE PROPDMG_SUM CROPDMG_SUM
## 20 FLOOD 132993008730 3519127900
## 34 HURRICANE/TYPHOON 69130840000 2607872800
## 52 STORM SURGE 43157757000 0
## 56 TORNADO 17605668460 219790900
## 19 FLASH FLOOD 10451154210 802794000