Health effects of different storm events were evaluated by taking the sum of the injuries and the fatalities for each type of event in the United States from 1050 to 2011.Tornadoes by far the storm event most harmful to human health by either assessment.Heat related events were also vert significant,especially as assessed by fatalities.Floods,lightning and thunderstorm wind also caused significant harm to the population.The economics consequences of different storm events were evaluated by taking the sum of property damage and crop damage for each type of event in the United States from 1050 to 2011.Hail caused the most property damage,but flooding,wind and lightning also caused very significant property damage.Hail caused the greatest amount of crop damage by far,but wind and flooding also caused significant crop damage.Overall the economic consequences were about eight-fold greater for property damage compared to crop damage.
The storm data were loaded from a csv file into a data frame. The data were cached since loading the data was time consuming.
The sums of the fatalities and injuries for each event were calculated, and subsets of the data including only events that comprised at least one percent of the totals of the fatalities and injuries, respectively, were taken to assess the significant health-related events. The totals for these events were summarized in a table and in bar plots for fatalities and for injuries. Factors for the event types were transformed to characters when combining the vectors of event types for fatalities and injuries.
Similarly, the sums of property damage and crop damage for each event were calculated, and subsets of the data including only events that comprised at least one percent of the totals of the property and crop damage, respectively, were taken to assess the economically significant events. The totals for these events were summarized in a table and in bar plots for property damage and crop damage. Factors for the event types were transformed to characters when combining the vectors of event types for property and crop damage.
findFile <- list.files(pattern = "bz2",full.names = TRUE)
stormData <- read.csv(bzfile(findFile))
# Taking sum of fatalities across event types
fatalities <- aggregate(FATALITIES ~ EVTYPE,stormData,sum)
fatalities <- fatalities[order(fatalities$FATALITIES,decreasing = TRUE),]
topFatalities <- fatalities[fatalities$FATALITIES > 0.01 * sum(fatalities$FATALITIES),]
head(topFatalities,2)
## EVTYPE FATALITIES
## 834 TORNADO 5633
## 130 EXCESSIVE HEAT 1903
# Taking sum of injuries
injuries <- aggregate(INJURIES ~ EVTYPE,stormData,sum)
injuries <- injuries[order(injuries$INJURIES,decreasing = TRUE),]
head(injuries,2)
## EVTYPE INJURIES
## 834 TORNADO 91346
## 856 TSTM WIND 6957
topInjuries <- injuries[injuries$INJURIES > 0.01 * sum(injuries$INJURIES),]
head(topInjuries,2)
## EVTYPE INJURIES
## 834 TORNADO 91346
## 856 TSTM WIND 6957
topHealth <- unique(c(as.character(topFatalities$EVTYPE),as.character(topInjuries$EVTYPE)))
# Combining fatalities and injuries for the combined event type in table
topEventHealth <- cbind(sapply(topHealth,function(x) fatalities[fatalities$EVTYPE == x,"FATALITIES"]),
sapply(topHealth,function(x) injuries[injuries$EVTYPE==x,"INJURIES"]))
colnames(topEventHealth) <- c("fatalities","injuries")
# taking sum of property damage
propertyDamage <- aggregate(PROPDMG~EVTYPE,stormData,sum)
propertyDamage <- propertyDamage[order(propertyDamage$PROPDMG,decreasing = TRUE),]
topDamageProp <- propertyDamage[propertyDamage$PROPDMG > 0.01 * sum(propertyDamage$PROPDMG),]
# taking sum of crop damage
cropdamage <- aggregate(CROPDMG~EVTYPE,stormData,sum)
cropdamage <- cropdamage[order(cropdamage$CROPDMG,decreasing = TRUE),]
topCropDamage <- cropdamage[cropdamage$CROPDMG > 0.01 * sum(cropdamage$CROPDMG),]
topPCdamage <- unique(c(as.character(topDamageProp$EVTYPE),as.character(topCropDamage$EVTYPE)))
# combining property and crop damage for the combined event types in table
topEventDamage <- cbind(sapply(topPCdamage,function(x) propertyDamage[ propertyDamage$EVTYPE==x,"PROPDMG"]),sapply(topPCdamage,function(x) cropdamage[cropdamage$EVTYPE==x,"CROPDMG"]))
colnames(topEventDamage) <- c("property.damage","crop.damage")
Table 1 Total fatalities and injuries for storm events that caused at least 1% of the either the fatalities or injuries
head(topEventHealth,13)
## fatalities injuries
## TORNADO 5633 91346
## EXCESSIVE HEAT 1903 6525
## FLASH FLOOD 978 1777
## HEAT 937 2100
## LIGHTNING 816 5230
## TSTM WIND 504 6957
## FLOOD 470 6789
## RIP CURRENT 368 232
## HIGH WIND 248 1137
## AVALANCHE 224 170
## WINTER STORM 206 1321
## RIP CURRENTS 204 297
## HEAT WAVE 172 309
Figure-1 Health effects of the storm events that caused at least 1% of the fatalities
barplot(topEventHealth[,"fatalities"],col = "orange",main = "Us Storm Events Causing The Most Fatalities",ylab = "Total Fatalities Per Event Type",las=2,cex.names = 0.55,cex.axis = 0.70)
Figure-2 Health effects of the storm events that caused at least 1% of the injuries
barplot(topEventHealth[,"injuries"],las=2,col = "purple",main = "Us Storm Events Causing The Most Injuries",ylab = "Total Injuries Per Event Type",cex.names = 0.55,cex.axis = 0.70)
print(" ")
## [1] " "
Table-2 Total property damage and crop damage for storm events that caused at least 1% of the either the property or crop damage.
head(topEventDamage,13)
## property.damage crop.damage
## TORNADO 3212258.16 100018.52
## FLASH FLOOD 1420124.59 179200.46
## TSTM WIND 1335965.61 109202.60
## FLOOD 899938.48 168037.88
## THUNDERSTORM WIND 876844.17 66791.45
## HAIL 688693.38 579596.28
## LIGHTNING 603351.78 3580.61
## THUNDERSTORM WINDS 446293.18 18684.93
## HIGH WIND 324731.56 17283.21
## WINTER STORM 132720.59 1978.99
## HEAVY SNOW 122251.99 2165.72
## DROUGHT 4099.05 33898.62
Figure-3 - The relative relative economic consequences of the storm events that caused at least 1% of the either the property damage or the crop damage.
par(mfrow=c(1,2),mar=c(15,4,3,2),mgp=c(3,1,0),cex=0.8)
barplot(round(topEventDamage[,"property.damage"] / 1000,0),main = "US Storm Property Damage",ylab = "Total Property Damage",las=2,col = "wheat")
barplot(round(topEventDamage[,"crop.damage"] / 1000,0),main = "US Storm Crop Damage",ylab = "Total Crop Damage",las=2,col = "pink")
print(" ")
## [1] " "