title: “Reproducible Project Week 4” author: “vince” date: “March 9, 2018” output: rmd_document

NOAA Storm Database

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:

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

DATA PROCESSING

setwd("C:/Users/wolfgang/downloads")
dloadurl <- "https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2"
download.file(dloadurl, "Stormdata.csv")
readfile <- read.csv(bzfile("Stormdata.csv"), sep =",", header = T)
evtype <- readfile$EVTYPE
stormfile <- readfile[, c('EVTYPE', 'FATALITIES', 'INJURIES', 'PROPDMG', 'PROPDMGEXP', 'CROPDMG', 'CROPDMGEXP')]
## Warning: package 'dplyr' was built under R version 3.4.3
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Warning: package 'ggplot2' was built under R version 3.4.3
## Warning: package 'gridExtra' was built under R version 3.4.3
## 
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
## 
##     combine

Across the United States, which types of events are the most harmful with respect to the population health?

Fatalities
Injuries
##             EVTYPE FATALITIES
## 834        TORNADO       5633
## 130 EXCESSIVE HEAT       1903
## 153    FLASH FLOOD        978
## 275           HEAT        937
## 464      LIGHTNING        816
## 856      TSTM WIND        504
##             EVTYPE INJURIES
## 834        TORNADO    91346
## 856      TSTM WIND     6957
## 170          FLOOD     6789
## 130 EXCESSIVE HEAT     6525
## 464      LIGHTNING     5230
## 275           HEAT     2100

By this chart we can conclude that Tornado as an event type has the highest level of Fatalities and Injuries.

Across the United States, which types of events have the greatest economic consequences?

##            EVENT_TYPE TOTAL_DAMAGE
## 170             FLOOD 150319678250
## 411 HURRICANE/TYPHOON  71913712800
## 834           TORNADO  57340613590
## 670       STORM SURGE  43323541000
## 244              HAIL  18752904670
## 153       FLASH FLOOD  17562128610

Based on this chart we can concluded the the highest cost event type is Flood. This has the greatest (adverse) economic impact.