Title: Exploring top 6 fatalities/injuries/property damage/crop damage in the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database

Introduction to the assignment

As stated in the assignment: Storms and other severe weather events can cause both public health and economic problems for communities and municipalities. Many severe events can result in fatalities, injuries, and property damage, and preventing such outcomes to the extent possible is a key concern.

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.

Synopsis

First data was loaded into R. Thereafter the date variabele was adjusted to represent a date. Next data file was filtered to cover only necessary events. These necessary events were cases in which there were reported fatalities, injuries, property damage or crop damage. To adress the 2 questions plots were constructed in which the top 6 events were shown with most fatalities/injuries/property damage/crop damage.

Data Processing

The data is loaded into R by using the following code:

download.file("https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2", destfile = "data.csv.bz2")

StormData<-read.csv("data.csv.bz2", header = TRUE, sep = ",")

The data is processed for analysis by R by using the following code:

#adjusting date variable
StormData$BGN_DATE <- as.Date(StormData$BGN_DATE, format='%m/%d/%Y')
#filtering only relevant data
StormData <- filter(StormData, FATALITIES > 0 | INJURIES > 0 | PROPDMG > 0 | CROPDMG > 0 )

Data Analysis

  1. Across the United States, which types of events (as indicated by the EVTYPE variable) are most harmful with respect to population health?
plot1<-StormData %>%
      select(FATALITIES, EVTYPE) %>%
      group_by(EVTYPE) %>%
      summarise(SumFATALITIES = sum(FATALITIES)) %>%
      top_n(n = 6, wt = SumFATALITIES) %>%
      ggplot(aes(y = SumFATALITIES, x = reorder(x = EVTYPE, X = SumFATALITIES), fill=EVTYPE))+
      geom_bar(stat = "identity", show.legend = FALSE) +
      xlab(label = "") +
      ylab(label = "FATALITIES") +
      coord_flip() +
      theme_classic()

plot2<-StormData %>%
      select(INJURIES, EVTYPE) %>%
      group_by(EVTYPE) %>%
      summarise(SumINJURIES = sum(INJURIES)) %>%
      top_n(n = 6, wt = SumINJURIES) %>%
      ggplot(aes(y = SumINJURIES, x = reorder(x = EVTYPE, X = SumINJURIES), fill=EVTYPE))+
      geom_bar(stat = "identity", show.legend = FALSE) +
      xlab(label = "") +
      ylab(label = "INJURIES") +
      coord_flip() +
      theme_classic()

grid.arrange(plot1, plot2, ncol = 2)

As can be seen in the figure above; the top events types causing most fatalities are; Tornade, Excessive Heat and Flash Flood, and the top events causing most injuries are Tornado, Tstm wind and Flood.

  1. Across the United States, which types of events have the greatest economic consequences?
# Order the dataset according to most StormFatalities
plot1<-StormData %>%
      select(PROPDMG, EVTYPE) %>%
      group_by(EVTYPE) %>%
      summarise(SumPROPDMG = sum(PROPDMG)) %>%
      top_n(n = 6, wt = SumPROPDMG) %>%
      ggplot(aes(y = SumPROPDMG, x = reorder(x = EVTYPE, X = SumPROPDMG), fill=EVTYPE))+
      geom_bar(stat = "identity", show.legend = FALSE) +
      xlab(label = "") +
      ylab(label = "PROPDMG") +
      coord_flip() +
      theme_classic()

plot2<-StormData %>%
      select(CROPDMG, EVTYPE) %>%
      group_by(EVTYPE) %>%
      summarise(SumCROPDMG = sum(CROPDMG)) %>%
      top_n(n = 6, wt = SumCROPDMG) %>%
      ggplot(aes(y = SumCROPDMG, x = reorder(x = EVTYPE, X = SumCROPDMG), fill=EVTYPE))+
      geom_bar(stat = "identity", show.legend = FALSE) +
      xlab(label = "") +
      ylab(label = "CROPDMG") +
      coord_flip() +
      theme_classic()

grid.arrange(plot1, plot2, ncol = 2)

As can be seen in the figure above; the top events types causing most property damage are; Tornado, Flash Flood and Tstm Wind, and the top events causing most crop damage are Hail, Flash Flood and Flood.

As a conclusion; The event of an tornado seems to cause most public health and economic problems.

knit2html()