THE MOST HARMFUL TYPE OF EVENTS IN EEUU

The basic goal of this report is to explore the NOAA Storm Database and answer some basic questions about severe weather events. It is required to use any R package to support the analysis.

The aim is to answer these two questions :

1.Across the United States, which types of events are most harmful with respect to population health? 2.Across the United States, which types of events have the greatest economic consequences?

To do that, we will get the information from NOAA Storm Database from 1950 to 2011 in csv format and then we will process the data by using R.

First we will calculate the most harmful type of event in terms of deaths, where we are going to plot the most 5 harmful type events. Afterwards, we will plot the most 5 harmful type events in terms of injuries and finally the most 5 harmful type events in the terms of economic damages.

Data Processing

First, the data can be reached by downloading from the source in csv format and load in R:

file="https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2"
download.file(file,dest="data_week5.bz2",method="curl")
data_input<-read.table("data_week5.bz2",sep=",",header=TRUE)

RESULTS

First, the most 5 harmful type of events in terms of fatalities has been obtained by using the code below

result_fatalities<-with(data_input, tapply(FATALITIES,EVTYPE,sum,na.rm=TRUE))
result_fatalities<-sort(result_fatalities,decreasing=TRUE)
result_fatalities[1:5]
##        TORNADO EXCESSIVE HEAT    FLASH FLOOD           HEAT      LIGHTNING 
##           5633           1903            978            937            816
barplot(result_fatalities[1:5], names.arg=as.factor(names(result_fatalities[1:5])),
        ylab="Number of Fatalities",xlab="The worst 5 Event Type")

Event_fatalities<-names(which.max(result_fatalities))

The most harmful event in terms of deaths is TORNADO

Aftewards, the most 5 harmful type of events in terms of injuries has been obtained with the code shown hereunder:

result_injuries<-with(data_input, tapply(INJURIES,EVTYPE,sum,na.rm=TRUE))
result_injuries<-sort(result_injuries,decreasing=TRUE)
result_injuries[1:5]
##        TORNADO      TSTM WIND          FLOOD EXCESSIVE HEAT      LIGHTNING 
##          91346           6957           6789           6525           5230
barplot(result_injuries[1:5], names.arg=as.factor(names(result_injuries[1:5])),
        ylab="Number of Injuries",xlab="The worst 5 Event Type")

Event_injuries<-names(which.max(result_injuries))

The most harmful event in terms of injuries is TORNADO

Finally, the top-five events with the greatest economic consequences are

result_property_damages<-with(data_input, tapply(PROPDMG,EVTYPE,sum,na.rm=TRUE))
result_property_damages<-sort(result_property_damages,decreasing=TRUE)
result_property_damages[1:5]
##           TORNADO       FLASH FLOOD         TSTM WIND             FLOOD 
##         3212258.2         1420124.6         1335965.6          899938.5 
## THUNDERSTORM WIND 
##          876844.2
barplot(result_property_damages[1:5]/1000000, names.arg=as.factor(names(result_property_damages[1:5])),
        ylab="Property Damages in Million",xlab="The worst 5 Event Type")

Event_damages<-names(which.max(result_property_damages))

The most harmful event in terms of damages is TORNADO