In this report, our goal is to observe the negative effects of weather phenomena in the United States. To do this we will observe the impact on health and the economy. We will analyze each phenomenon and in each area we will choose the 10 that have the greatest individual impact when it occurs. We will build on he 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.
From the National Weather Service we obtained the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database. The events in the database start in the year 1950 and end in November 2011.
We obtained the file Storm Data.
The packages to be used for the project are:
library(dplyr)
library(ggplot2)
SData = read.csv('repdata_data_StormData.csv', header = T)
The data is filtered according to the catastrophic events column (EVTYPE) and the two columns related to population health (INJURIES and FATALITIES) are added together. The mean per event is obtained to find which event is more catastrophic each time it occurs.
PSData1 <- SData[,c(8,23,24)]
PSData1$harm <- PSData1$FATALITIES+PSData1$INJURIES
PSData1F <- aggregate(harm~EVTYPE, data = PSData1, FUN=mean, na.rm=TRUE)
PSData1F <- head(PSData1F[order(PSData1F$harm,decreasing = TRUE),], n = 10)
head(PSData1F)
## EVTYPE harm
## 277 Heat Wave 70.00
## 851 TROPICAL STORM GORDON 51.00
## 954 WILD FIRES 38.25
## 821 THUNDERSTORMW 27.00
## 842 TORNADOES, TSTM WIND, HAIL 25.00
## 366 HIGH WIND AND SEAS 23.00
The data is filtered according to the catastrophic events column (EVTYPE) and the two columns related to the economy (PROPDMG and CROPDMG).
The two columns referring to the economy are separated, to obtain separate results. Although in parallel the mean per event is obtained to find which event is more catastrophic each time it occurs.
PDSData1 <- SData[,c(8,25)]
PDSData1 <- aggregate(PROPDMG~EVTYPE, data = PDSData1, FUN=mean, na.rm=TRUE)
PDSData1 <- head(PDSData1[order(PDSData1$PROPDMG,decreasing = TRUE),], n = 10)
head(PDSData1)
## EVTYPE PROPDMG
## 52 COASTAL EROSION 766
## 291 HEAVY RAIN AND FLOOD 600
## 589 RIVER AND STREAM FLOOD 600
## 445 Landslump 570
## 38 BLIZZARD/WINTER STORM 500
## 158 FLASH FLOOD/ 500
CDSData1 <- SData[,c(8,27)]
CDSData1 <- aggregate(CROPDMG~EVTYPE, data = CDSData1, FUN=mean, na.rm=TRUE)
CDSData1 <- head(CDSData1[order(CDSData1$CROPDMG,decreasing = TRUE),], n = 10)
head(CDSData1)
## EVTYPE CROPDMG
## 118 DUST STORM/HIGH WINDS 500.000
## 190 FOREST FIRES 500.000
## 851 TROPICAL STORM GORDON 500.000
## 392 HIGH WINDS/COLD 401.000
## 407 HURRICANE FELIX 250.000
## 591 River Flooding 241.368
Analyzing the damage generated by the occurrence of each meteorological event. From the data processing:
The event that has the greatest impact each time it occurs is the heat wave.
Second tropical storm gordon and third wild fires.
library(ggplot2)
ggplot(PSData1F,aes(reorder(EVTYPE,harm), harm)) +
geom_bar(fill="#9F7EC4", color="#FAA3F4", stat = "identity") +
scale_fill_brewer(palette = "Set1") +
theme(axis.text.x = element_text(angle = 50, hjust = 1)) +
xlab("Meteorological event") +
ggtitle("Most catastrophic weather event")
Results are divided by Property Damage and Crop damage.
Property Damage
Analyzing the damage generated by the occurrence of each meteorological event. From the data processing:
The event that has the greatest impact each time it occurs is the coastal erosion.
Second heavy rain and flood and also river and stream flood.
ggplot(PDSData1,aes(reorder(EVTYPE,PROPDMG), PROPDMG)) +
geom_bar(fill="#9F7EC4", color="#FAA3F4", stat = "identity") +
scale_fill_brewer(palette = "Set1") +
theme(axis.text.x = element_text(angle = 50, hjust = 1)) +
xlab("Meteorological event") +
ylab("Property Damage")+
ggtitle("Most catastrophic weather event for the economy - property damage")
Crop damage
Analyzing the damage generated by the occurrence of each meteorological event. From the data processing:
ggplot(CDSData1,aes(reorder(EVTYPE,CROPDMG), CROPDMG)) +
geom_bar(fill="#9F7EC4", color="#FAA3F4", stat = "identity") +
scale_fill_brewer(palette = "Set1") +
theme(axis.text.x = element_text(angle = 50, hjust = 1)) +
xlab("Meteorological event") +
ylab("Crop Damage")+
ggtitle("Most catastrophic weather event for the economy - crop damage")