This analysis identifies the adverse weather events with most harmful impact on public health and the econonomy in US communities and municipalities. The data [Storm Data] from this analysis is taken from the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database from Year 1950 to November 2011.Supporting documentations are National Weather Service Storm Data Documentation and National Climatic Data Center Storm Events FAQ.
Public health impact are identified by summing up number of fatalities in the FATALITIES field and injuries in the INJURIES field for an event as identified by the EVTYPE in the NOAA storm database. Economic impact are identified by summing up the cost of crops damaged in the CROPDMG field and the property damaged in the PROPDMG field for an event type as identified by the EVTYPE in the NOAA storm database.
This analysis identifies these events in order of most impactful on public health and economic problem by providing a tables and bar charts.
The data file is downloaded using R from the URL location and saved as StormData.csv.bz2
The file is read into the data frame StormData
#Download file
download.file("http://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2",mode="wb", destfile = "stormData.csv.bz2")
##Read file
StormData <- read.csv(bzfile("stormData.csv.bz2"))
The required R libraries are loaded
##
## Attaching package: 'dplyr'
##
## The following object is masked from 'package:stats':
##
## filter
##
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
Two additional variables are created and appended to the data frame
1. totalHumanImpact - the sum of number of injuries and fatalities. This represents the total Population impact.
2. totalEconomicImpact - the total cost of property and crops damaged. This represents the economic impact.
StormData <- tbl_df(StormData) %>%
mutate(totalHumanImpact = INJURIES + FATALITIES, totalEconomicImpact = PROPDMG + CROPDMG )
The populationHealthByEVType is created. It contains the total population impacted by each event ordered by most impactful at the top and the least impactful at the bottom.
populationHealthByEVTYPE <- group_by(StormData, EVTYPE)%>%
summarize(count=sum(totalHumanImpact)) %>%
arrange(desc(count))
economicImpactByEVTYPE <- group_by(StormData, EVTYPE)%>%
summarize(cost=sum(totalEconomicImpact)) %>%
arrange(desc(cost))
data.frame(populationHealthByEVTYPE[1:30,])
## EVTYPE count
## 1 TORNADO 96979
## 2 EXCESSIVE HEAT 8428
## 3 TSTM WIND 7461
## 4 FLOOD 7259
## 5 LIGHTNING 6046
## 6 HEAT 3037
## 7 FLASH FLOOD 2755
## 8 ICE STORM 2064
## 9 THUNDERSTORM WIND 1621
## 10 WINTER STORM 1527
## 11 HIGH WIND 1385
## 12 HAIL 1376
## 13 HURRICANE/TYPHOON 1339
## 14 HEAVY SNOW 1148
## 15 WILDFIRE 986
## 16 THUNDERSTORM WINDS 972
## 17 BLIZZARD 906
## 18 FOG 796
## 19 RIP CURRENT 600
## 20 WILD/FOREST FIRE 557
## 21 RIP CURRENTS 501
## 22 HEAT WAVE 481
## 23 DUST STORM 462
## 24 WINTER WEATHER 431
## 25 TROPICAL STORM 398
## 26 AVALANCHE 394
## 27 EXTREME COLD 391
## 28 STRONG WIND 383
## 29 DENSE FOG 360
## 30 HEAVY RAIN 349
qplot(EVTYPE, data=populationHealthByEVTYPE[1:5,] , geom="bar", weight=count,xlab="Event Type[EVTYPE]", ylab="Total Population Impacted",main = "Bar Chart of Top 5 Events Most Impacting the Population Health")
data.frame(economicImpactByEVTYPE [1:30,])
## EVTYPE cost
## 1 TORNADO 3312276.68
## 2 FLASH FLOOD 1599325.05
## 3 TSTM WIND 1445168.21
## 4 HAIL 1268289.66
## 5 FLOOD 1067976.36
## 6 THUNDERSTORM WIND 943635.62
## 7 LIGHTNING 606932.39
## 8 THUNDERSTORM WINDS 464978.11
## 9 HIGH WIND 342014.77
## 10 WINTER STORM 134699.58
## 11 HEAVY SNOW 124417.71
## 12 WILDFIRE 88823.54
## 13 ICE STORM 67689.62
## 14 STRONG WIND 64610.71
## 15 HEAVY RAIN 61964.94
## 16 HIGH WINDS 57384.60
## 17 TROPICAL STORM 54322.80
## 18 WILD/FOREST FIRE 43534.49
## 19 DROUGHT 37997.67
## 20 FLASH FLOODING 33623.20
## 21 URBAN/SML STREAM FLD 28845.74
## 22 BLIZZARD 25490.48
## 23 HURRICANE 20852.99
## 24 FLOOD/FLASH FLOOD 20580.95
## 25 STORM SURGE 19398.49
## 26 LANDSLIDE 18998.94
## 27 RIVER FLOOD 17345.70
## 28 URBAN FLOOD 14216.50
## 29 LAKE-EFFECT SNOW 14141.00
## 30 EXTREME COLD 13778.68
qplot(EVTYPE, data=economicImpactByEVTYPE[1:5,] , geom="bar", weight=cost,xlab="Event Type[EVTYPE]", ylab="Total Economic Impact",main = "Bar Chart of Top 5 Events Most Economic Impact")