This Document contains information regarding U.S National Oceanic and Atmospheric Admnistrations (NOA) storm database.
Themes included in this paper are related to the impact on economic and Health caused by the most recorded natural disasters in the US.
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.
setwd("E:/DScience/Reproducible_Research/Week4")
getwd()
## [1] "E:/DScience/Reproducible_Research/Week4"
data <-read.csv("repdata%2Fdata%2FStormData.csv.bz2")
head(data)
## 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
In order to have a quick view of the kind of data we will be dealing with we can go ahead and use some of the R tools to visualize. but first we will need to filter the data we want to work with. We will start with collecting information about the fatalities for each event type.
fatalities <- aggregate(FATALITIES ~ EVTYPE, data = data, sum)
fatalities <- fatalities[fatalities$FATALITIES > 0,]
fatalities_desc <- fatalities[order(fatalities$FATALITIES, decreasing = TRUE),]
head(fatalities_desc)
## EVTYPE FATALITIES
## 834 TORNADO 5633
## 130 EXCESSIVE HEAT 1903
## 153 FLASH FLOOD 978
## 275 HEAT 937
## 464 LIGHTNING 816
## 856 TSTM WIND 504
Besides fatalities we can compute information related to the injuries.
Injuries <- aggregate(INJURIES ~ EVTYPE, data = data, sum)
Injuries <- Injuries[Injuries$INJURIES > 0,]
Injuries_desc <- Injuries[order(Injuries$INJURIES, decreasing = TRUE),]
head(Injuries_desc)
## EVTYPE INJURIES
## 834 TORNADO 91346
## 856 TSTM WIND 6957
## 170 FLOOD 6789
## 130 EXCESSIVE HEAT 6525
## 464 LIGHTNING 5230
## 275 HEAT 2100
Here is a summary for fatalities for different events( in form of ggplot graph)
par(mfrow = c(1,1))
barplot(fatalities_desc[1:5, 2],col=rainbow(5), names = fatalities_desc[1:5, 1], ylab = "Fatality", main = "top events")
In order to answer this question we will need to extract two variables, PROPDMG and CROPDMG.
PropretyDemages <- aggregate(PROPDMG ~ EVTYPE, data = data, sum)
PropretyDemages <-PropretyDemages[PropretyDemages$PROPDMG >0,]
propretyDemages_desc <- PropretyDemages[order(PropretyDemages$PROPDMG,decreasing = TRUE),]
head(propretyDemages_desc)
par(mfrow = c(1,1))
PropretyDemages <- aggregate(PROPDMG ~ EVTYPE, data = data, sum)
propretyDemages_desc <- PropretyDemages[order(PropretyDemages$PROPDMG,decreasing = TRUE),]
barplot(propretyDemages_desc[1:10, 2], col = "green", legend.text = propretyDemages_desc[1:10,1], ylab = "propretyDemages", main = "Most proprety Demages")
cropDemages <- aggregate(CROPDMG ~ EVTYPE, data = data, sum)
cropDemages <-cropDemages[cropDemages$CROPDMG >0,]
cropDemages_desc <- cropDemages[order(cropDemages$CROPDMG,decreasing = TRUE),]
head(cropDemages_desc)
## EVTYPE CROPDMG
## 244 HAIL 579596.28
## 153 FLASH FLOOD 179200.46
## 170 FLOOD 168037.88
## 856 TSTM WIND 109202.60
## 834 TORNADO 100018.52
## 760 THUNDERSTORM WIND 66791.45