Exploration of NOAA Storm Databse

Synopsis

Storms and other harmful weather events results in health and economic damages. Such damages should be prevented. So,this assignment aims to explore the NOAA Storm Database and answer some basic questions about severe weather events. The events in the database start in the year 1950 and end in November 2011. The Storm data is explored and the count of the fatalities, injuries and property damages are calculated and plotted in the report. From the graphs, we can understand the severity of weather events and prioritize the resources as needed for the different types of events.

Purpose

The purpose of this assignment is:

to make us learn to generate RMarkdown document to know the importance of reproducibility to analyse the data and produce answers for the given questions

Data loading and Processing

  storm <- read.csv("stormdata.csv",header=TRUE,sep=",")
  head(storm)
##   STATE__           BGN_DATE BGN_TIME TIME_ZONE COUNTY COUNTYNAME STATE
## 1       1  4/18/1950 0:00:00     0130       CST     97     MOBILE    AL
## 2       1  4/18/1950 0:00:00     0145       CST      3    BALDWIN    AL
## 3       1  2/20/1951 0:00:00     1600       CST     57    FAYETTE    AL
## 4       1   6/8/1951 0:00:00     0900       CST     89    MADISON    AL
## 5       1 11/15/1951 0:00:00     1500       CST     43    CULLMAN    AL
## 6       1 11/15/1951 0:00:00     2000       CST     77 LAUDERDALE    AL
##    EVTYPE BGN_RANGE BGN_AZI BGN_LOCATI END_DATE END_TIME COUNTY_END
## 1 TORNADO         0                                               0
## 2 TORNADO         0                                               0
## 3 TORNADO         0                                               0
## 4 TORNADO         0                                               0
## 5 TORNADO         0                                               0
## 6 TORNADO         0                                               0
##   COUNTYENDN END_RANGE END_AZI END_LOCATI LENGTH WIDTH F MAG FATALITIES
## 1         NA         0                      14.0   100 3   0          0
## 2         NA         0                       2.0   150 2   0          0
## 3         NA         0                       0.1   123 2   0          0
## 4         NA         0                       0.0   100 2   0          0
## 5         NA         0                       0.0   150 2   0          0
## 6         NA         0                       1.5   177 2   0          0
##   INJURIES PROPDMG PROPDMGEXP CROPDMG CROPDMGEXP WFO STATEOFFIC ZONENAMES
## 1       15    25.0          K       0                                    
## 2        0     2.5          K       0                                    
## 3        2    25.0          K       0                                    
## 4        2     2.5          K       0                                    
## 5        2     2.5          K       0                                    
## 6        6     2.5          K       0                                    
##   LATITUDE LONGITUDE LATITUDE_E LONGITUDE_ REMARKS REFNUM
## 1     3040      8812       3051       8806              1
## 2     3042      8755          0          0              2
## 3     3340      8742          0          0              3
## 4     3458      8626          0          0              4
## 5     3412      8642          0          0              5
## 6     3450      8748          0          0              6

Results

Harmful Events with respect to Population Health

With respect to the Population Health, there are two damages caused : fatalities and injuries. The top 10 severity of the harmful events are analysed and plotted below.

Fatalities

##aggregate the fatalities by the event type and sort the output in descending order

fatal <- aggregate(FATALITIES~EVTYPE,data=storm,FUN=sum,na.rm=TRUE)
fatal <- fatal[with(fatal,order(-FATALITIES)),]
fatal <- head(fatal,10)
print(fatal)
##             EVTYPE FATALITIES
## 834        TORNADO       5633
## 130 EXCESSIVE HEAT       1903
## 153    FLASH FLOOD        978
## 275           HEAT        937
## 464      LIGHTNING        816
## 856      TSTM WIND        504
## 170          FLOOD        470
## 585    RIP CURRENT        368
## 359      HIGH WIND        248
## 19       AVALANCHE        224

Injuries

##aggregate the injuries by the event type and sort the output in descending order

injury <- aggregate(INJURIES~EVTYPE,data=storm,FUN=sum,na.rm=TRUE)
injury <- injury[with(injury,order(-INJURIES)),]
injury <- head(injury,10)
print(injury)
##                EVTYPE INJURIES
## 834           TORNADO    91346
## 856         TSTM WIND     6957
## 170             FLOOD     6789
## 130    EXCESSIVE HEAT     6525
## 464         LIGHTNING     5230
## 275              HEAT     2100
## 427         ICE STORM     1975
## 153       FLASH FLOOD     1777
## 760 THUNDERSTORM WIND     1488
## 244              HAIL     1361
par(mfrow=c(1,2),mar=c(10,3,3,2))
##plot the graph showing the top 10 fatalities and injuries
barplot(fatal$FATALITIES,names.arg=fatal$EVTYPE,las=2,col="cyan",ylab="fatalities",main="Harmful Events Vs Top 10 fatalities")
barplot(injury$INJURIES,names.arg=injury$EVTYPE,las=2,col="cyan",ylab="injuries",main="Harmful Events Vs Top 10 Injuries")

Thus, across U.S, Tornado has caused the highest fatality rate and injuries.

Harmful Events causing greatest economic consequences

With respect to the ecomonic consequneces, there are two damages caused: Property damage and crop damage. Let’s explore these two variables from the data.

Exploration of data

On exploring the column names of the data, we find that the property damage(PROPDMG) and crop damage(CROPDMG) columns has another column(exponents) related to it, i.e PROPDMGEXP and CROPDMGEXP respectively. So, for the calculation of the total property and crop damages caused, we need to convert the exponent columns into numeric data.

unique(storm$PROPDMGEXP)
##  [1] K M   B m + 0 5 6 ? 4 2 3 h 7 H - 1 8
## Levels:  - ? + 0 1 2 3 4 5 6 7 8 B h H K m M

convert the exponents into numeric value and thus calculate the property damage

storm$PROPDMG[storm$PROPDMGEXP == "K"] <- storm$PROPDMG[storm$PROPDMGEXP == "K"] * 1000
storm$PROPDMG[storm$PROPDMGEXP == "M"] <- storm$PROPDMG[storm$PROPDMGEXP == "M"] * (10^6)
storm$PROPDMG[storm$PROPDMGEXP == "H"] <- storm$PROPDMG[storm$PROPDMGEXP == "H"] * 100
storm$PROPDMG[storm$PROPDMGEXP == "h"] <- storm$PROPDMG[storm$PROPDMGEXP == "h"] * 100
storm$PROPDMG[storm$PROPDMGEXP == ""] <- storm$PROPDMG[storm$PROPDMGEXP == ""] * 1
storm$PROPDMG[storm$PROPDMGEXP == "B"] <- storm$PROPDMG[storm$PROPDMGEXP == "B"] * (10^9)
storm$PROPDMG[storm$PROPDMGEXP == "m"] <- storm$PROPDMG[storm$PROPDMGEXP == "m"] * (10^6)
storm$PROPDMG[storm$PROPDMGEXP == "0"] <- storm$PROPDMG[storm$PROPDMGEXP == "0"] * 1
storm$PROPDMG[storm$PROPDMGEXP == "1"] <- storm$PROPDMG[storm$PROPDMGEXP == "1"] * 10
storm$PROPDMG[storm$PROPDMGEXP == "2"] <- storm$PROPDMG[storm$PROPDMGEXP == "2"] * 100
storm$PROPDMG[storm$PROPDMGEXP == "3"] <- storm$PROPDMG[storm$PROPDMGEXP == "3"] * 1000
storm$PROPDMG[storm$PROPDMGEXP == "4"] <- storm$PROPDMG[storm$PROPDMGEXP == "4"] * (10^4)
storm$PROPDMG[storm$PROPDMGEXP == "5"] <- storm$PROPDMG[storm$PROPDMGEXP == "5"] * (10^5)
storm$PROPDMG[storm$PROPDMGEXP == "6"] <- storm$PROPDMG[storm$PROPDMGEXP == "6"] * (10^6)
storm$PROPDMG[storm$PROPDMGEXP == "7"] <- storm$PROPDMG[storm$PROPDMGEXP == "7"] * (10^7)
storm$PROPDMG[storm$PROPDMGEXP == "8"] <- storm$PROPDMG[storm$PROPDMGEXP == "8"] * (10^8)
storm$PROPDMG[storm$PROPDMGEXP == "+"] <- 0
storm$PROPDMG[storm$PROPDMGEXP == "-"] <- 0
storm$PROPDMG[storm$PROPDMGEXP == "?"] <- 0
head(storm[,c("EVTYPE","PROPDMG","PROPDMGEXP")])
##    EVTYPE PROPDMG PROPDMGEXP
## 1 TORNADO   25000          K
## 2 TORNADO    2500          K
## 3 TORNADO   25000          K
## 4 TORNADO    2500          K
## 5 TORNADO    2500          K
## 6 TORNADO    2500          K
unique(storm$CROPDMGEXP)
## [1]   M K m B ? 0 k 2
## Levels:  ? 0 2 B k K m M

convert the exponents into numeric value and thus calculate the crop damage

storm$CROPDMG[storm$CROPDMGEXP == "M"] <- storm$CROPDMG[storm$CROPDMGEXP == "M"] * (10^6)
storm$CROPDMG[storm$CROPDMGEXP == "K"] <- storm$CROPDMG[storm$CROPDMGEXP == "K"] * 1000
storm$CROPDMG[storm$CROPDMGEXP == "m"] <- storm$CROPDMG[storm$CROPDMGEXP == "m"] * (10^6)
storm$CROPDMG[storm$CROPDMGEXP == "B"] <- storm$CROPDMG[storm$CROPDMGEXP == "B"] * (10^9)
storm$CROPDMG[storm$CROPDMGEXP == "k"] <- storm$CROPDMG[storm$CROPDMGEXP == "k"] * 1000
storm$CROPDMG[storm$CROPDMGEXP == "0"] <- storm$CROPDMG[storm$CROPDMGEXP == "0"] * 1
storm$CROPDMG[storm$CROPDMGEXP == "2"] <- storm$CROPDMG[storm$CROPDMGEXP == "2"] * 100
storm$CROPDMG[storm$CROPDMGEXP == ""] <- storm$CROPDMG[storm$CROPDMGEXP == ""] * 1
storm$CROPDMG[storm$CROPDMGEXP == "?"] <- 0
head(storm[,c("EVTYPE","CROPDMG","CROPDMGEXP")])
##    EVTYPE CROPDMG CROPDMGEXP
## 1 TORNADO       0           
## 2 TORNADO       0           
## 3 TORNADO       0           
## 4 TORNADO       0           
## 5 TORNADO       0           
## 6 TORNADO       0

Property Damage

aggregating the property damage by the event type and sort the output it in descending order

prop <- aggregate(PROPDMG~EVTYPE,data=storm,FUN=sum,na.rm=TRUE)
prop <- prop[with(prop,order(-PROPDMG)),]
prop <- head(prop,10)
print(prop)
##                EVTYPE      PROPDMG
## 170             FLOOD 144657709807
## 411 HURRICANE/TYPHOON  69305840000
## 834           TORNADO  56947380617
## 670       STORM SURGE  43323536000
## 153       FLASH FLOOD  16822673979
## 244              HAIL  15735267513
## 402         HURRICANE  11868319010
## 848    TROPICAL STORM   7703890550
## 972      WINTER STORM   6688497251
## 359         HIGH WIND   5270046260

Crop Damage

aggregate the crop damage by the event type and sort the output it in descending order

crop <- aggregate(CROPDMG~EVTYPE,data=storm,FUN=sum,na.rm=TRUE)
crop <- crop[with(crop,order(-CROPDMG)),]
crop <- head(crop,10)
print(crop)
##                EVTYPE     CROPDMG
## 95            DROUGHT 13972566000
## 170             FLOOD  5661968450
## 590       RIVER FLOOD  5029459000
## 427         ICE STORM  5022113500
## 244              HAIL  3025954473
## 402         HURRICANE  2741910000
## 411 HURRICANE/TYPHOON  2607872800
## 153       FLASH FLOOD  1421317100
## 140      EXTREME COLD  1292973000
## 212      FROST/FREEZE  1094086000
par(mfrow=c(1,2),mar=c(11,3,3,2))
 ##plot the graph showing the top 10 property and crop damages
barplot(prop$PROPDMG/(10^9),names.arg=prop$EVTYPE,las=2,col="green",ylab="Prop.damage(billions)",main="Events Vs Top10 Prop.Damages")
barplot(crop$CROPDMG/(10^9),names.arg=crop$EVTYPE,las=2,col="green",ylab="Crop damage(billions)",main="Events Vs Top10 Crop.Damages")

Thus, across U.S, flood has caused the greatest property damage and drought has caused the greatest crop damage.

Summary

Thus, the NOAA storm dataset was explored and the severity of weather events were analysed.