Analysis of NOAA Storm Database

The basic goal of this assignment is to explore the NOAA Storm Database.

DATA PROCESSING

library("data.table") 
library("ggplot2")
setwd("C:/Users/Pavitra/Desktop")
storm<-read.csv("repdata_data_StormData.csv.bz2")
colnames(storm)
##  [1] "STATE__"    "BGN_DATE"   "BGN_TIME"   "TIME_ZONE"  "COUNTY"    
##  [6] "COUNTYNAME" "STATE"      "EVTYPE"     "BGN_RANGE"  "BGN_AZI"   
## [11] "BGN_LOCATI" "END_DATE"   "END_TIME"   "COUNTY_END" "COUNTYENDN"
## [16] "END_RANGE"  "END_AZI"    "END_LOCATI" "LENGTH"     "WIDTH"     
## [21] "F"          "MAG"        "FATALITIES" "INJURIES"   "PROPDMG"   
## [26] "PROPDMGEXP" "CROPDMG"    "CROPDMGEXP" "WFO"        "STATEOFFIC"
## [31] "ZONENAMES"  "LATITUDE"   "LONGITUDE"  "LATITUDE_E" "LONGITUDE_"
## [36] "REMARKS"    "REFNUM"
stormd<-as.data.table(storm)

Events that are Most Harmful to Population Health

RESULTS:

dfat<-aggregate(FATALITIES~EVTYPE,stormd,sum)
dfat<-dfat[order(dfat$FATALITIES,decreasing = T),]
g<-ggplot(dfat[1:10,],aes(x=reorder(EVTYPE, -FATALITIES), y=FATALITIES))+geom_bar(fill="lightblue",stat="identity")+labs(list(title="FATALITY DUE TO EVENTS IN US",x="Weather Evemt",y="Fatality"))
g

#### Events that have the Greatest Economic Consequences

dprop<-aggregate(PROPDMG~EVTYPE,stormd,sum)
dprop<-dprop[order(dprop$PROPDMG,decreasing = T),]
g<-ggplot(dprop[1:10,],aes(x=reorder(EVTYPE, -PROPDMG), y=PROPDMG))+geom_bar(fill="lightgreen",stat="identity")+labs(list(title="PROPperty DaMaGe DUE TO EVENTS IN US",x="Weather Evemt",y="property damage"))
g