Storm Data Synopsis This project involves exploring the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database. This database 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.

Loading and Processing the raw data
storm_data <- read.csv('data/repdata_data_StormData.csv')

Results

Impact of severe weather events- fatalities

fatalities <- aggregate (FATALITIES ~ EVTYPE, data = storm_data, FUN = "sum") 
fatalities <- arrange(fatalities, desc(fatalities[,2]))
top10fatalities <- fatalities[1:10,]
head(top10fatalities)
##           EVTYPE FATALITIES
## 1        TORNADO       5633
## 2 EXCESSIVE HEAT       1903
## 3    FLASH FLOOD        978
## 4           HEAT        937
## 5      LIGHTNING        816
## 6      TSTM WIND        504
Impact of severe weather events- injuries
injuries <- aggregate (INJURIES ~ EVTYPE, data = storm_data, FUN = "sum") 
injuries <- arrange(injuries, desc(injuries[,2]))
top10injuries <- injuries[1:10,]
head(top10injuries)
##           EVTYPE INJURIES
## 1        TORNADO    91346
## 2      TSTM WIND     6957
## 3          FLOOD     6789
## 4 EXCESSIVE HEAT     6525
## 5      LIGHTNING     5230
## 6           HEAT     2100
Plotting results for fatalities and injures
Tornados are the weather event in the united states that cause both the most injuries and fatalities.
fatalities_plot <- ggplot(top10fatalities, aes(x = reorder(EVTYPE, -FATALITIES), y = FATALITIES)) + geom_bar(stat = 'identity') + xlab("Weather Event") + ylab("No. Fatalities") + ggtitle("Top 10 Fatalities")
  
injuries_plot <- ggplot(top10injuries, aes(x = reorder(EVTYPE, -INJURIES), y = INJURIES)) + geom_bar(stat = 'identity') + xlab("Weather Event") + ylab("No.Injuries") + ggtitle("Top 10 Injuries")

grid.arrange(fatalities_plot,injuries_plot,nrow=1 )

Impact of severe weather events- economic property damage
property_damage <- aggregate(PROPDMG ~ EVTYPE, data = storm_data, FUN = 'sum')
property_damage <- arrange(property_damage, desc(property_damage[, 2]))
top10property_damage <- property_damage[1:10,]
head(top10property_damage)
##              EVTYPE   PROPDMG
## 1           TORNADO 3212258.2
## 2       FLASH FLOOD 1420124.6
## 3         TSTM WIND 1335965.6
## 4             FLOOD  899938.5
## 5 THUNDERSTORM WIND  876844.2
## 6              HAIL  688693.4
Impact of severe weather events- economic crop damage
crop_damage <- aggregate(CROPDMG ~ EVTYPE, data = storm_data, FUN = 'sum')
crop_damage <- arrange(crop_damage, desc(crop_damage[, 2]))
top10crop_damage <- crop_damage[1:10,]
head(top10crop_damage)
##              EVTYPE   CROPDMG
## 1              HAIL 579596.28
## 2       FLASH FLOOD 179200.46
## 3             FLOOD 168037.88
## 4         TSTM WIND 109202.60
## 5           TORNADO 100018.52
## 6 THUNDERSTORM WIND  66791.45
Plotting results for property and crop damage
The weather event causing the most property damage across the united states are Tornados which are much higher than the next weather event that cuases the most damage, Flash Floods.
Looking at Crop damage it’s a different story, Hail causes the most crop damage across the united states followed again by flash Floods.
property_plot <- ggplot(top10property_damage, aes(x = reorder(EVTYPE, -PROPDMG), y = PROPDMG)) + geom_bar(stat = 'identity') + xlab("Weather Event") + ylab("Property Damage") + ggtitle("Top 10 Property Damage")
  
crop_plot <- ggplot(top10crop_damage, aes(x = reorder(EVTYPE, -CROPDMG), y = CROPDMG)) + geom_bar(stat = 'identity') + xlab("Weather Event") + ylab("Crop Damage") + ggtitle("Top 10 Crop Damage")

grid.arrange(property_plot,crop_plot,nrow=1 )