Research synopsis / Most Harmful weather eventes NOAA

Sinopsis de la investigacion / Los fenomenos climaticos mas severos NOAA

The event with the most economic damage are floods and tornados, between 1993 and 2011. It is the Tornado. Because this phenomenon is the most damaging, around injuries, casualties and economic consequences. It also describes the top ten most severe weather events from the storm database between 1993 and 2011.

El evento con más daño económico son las inundaciones y tornados, entre los años 1993 y 2011. Es el Tornado. Debido a que este fenomeno es el mas dañino, en alrededor de heridos, bajas y consecuencias economicas. Tambien se describen los diez principales eventos climáticos mas severos de la base de datos de tormentas entre los años 1993 y 2011.

## Setting up / cargando
library(ggplot2)
## Data process / Procesamiento de datos
setwd("D:/Documents/Johns Hopkings University/05 Reproducible Research/Course Project 2")
storm <- read.csv("repdata_data_StormData.csv.bz2")
names(storm)
##  [1] "STATE__"    "BGN_DATE"   "BGN_TIME"   "TIME_ZONE"  "COUNTY"    
##  [6] "COUNTYNAME" "STATE"      "EVTYPE"     "BGN_RANGE"  "BGN_AZI"   
## [11] "BGN_LOCATI" "END_DATE"   "END_TIME"   "COUNTY_END" "COUNTYENDN"
## [16] "END_RANGE"  "END_AZI"    "END_LOCATI" "LENGTH"     "WIDTH"     
## [21] "F"          "MAG"        "FATALITIES" "INJURIES"   "PROPDMG"   
## [26] "PROPDMGEXP" "CROPDMG"    "CROPDMGEXP" "WFO"        "STATEOFFIC"
## [31] "ZONENAMES"  "LATITUDE"   "LONGITUDE"  "LATITUDE_E" "LONGITUDE_"
## [36] "REMARKS"    "REFNUM"
length(table(storm$EVTYPE))
## [1] 985
# Converting to lowercase and setting up the data / Convirtiendo a minuscula y acomodando la data
event_types <- tolower(storm$EVTYPE)
event_types <- gsub("[[:blank:][:punct:]+]", " ", event_types)
length(unique(event_types))
## [1] 874
# Update the data frame / Actualizando la tabla de datos
storm$EVTYPE <- event_types

Answers and Discussion / Respuestas y discusiones

What are the most harmful weather event respectfully to the population health Cuáles son los fenómenos meteorológicos más dañinos con respecto a la salud de la población

# Setting data / Configurando los datos
Fata_per_evt <- aggregate(FATALITIES ~ EVTYPE, data=storm, sum)
Inj_per_evt <- aggregate(INJURIES ~ EVTYPE, data=storm, sum)
# Setting event types for FATALITIES / Configurando los valores del tipo
Fata_per_evt_Top10 <- head(Fata_per_evt[order(Fata_per_evt$FATALITIES, decreasing = TRUE),],10)
# Setting event types for INJURIES / Configurando los valores del tipo
Inj_per_evt_Top10 <- head(Inj_per_evt[order(Inj_per_evt$INJURIES, decreasing = TRUE),],10)
# Order the levels / Ordenando los niveles
ggplot(data=Fata_per_evt_Top10,aes(x=reorder(EVTYPE, FATALITIES), y=FATALITIES, fill=FATALITIES)) +
    geom_bar(stat="identity") + coord_flip() + ylab("Total number of FATALITIES") + xlab("Event type") +
    theme(legend.position="none")

ggplot(data=Inj_per_evt_Top10, aes(x=reorder(EVTYPE, INJURIES), y=INJURIES, fill=INJURIES)) +
    geom_bar(stat="identity") + coord_flip() + ylab("Total number of injuries") + xlab("Event type") +
    theme(legend.position="none")