In this report, I aim to answer 2 questions: Which natural disasters brought the most harm to the population health and to the economic conditions for the period from 4/18/1950 and 11/28/2011. To address these questions, I took the data from the National Oceanic and Atmospheric Administration, which was collected by the National Weather Service. The National Weather service receives their information from a variety of sources, which include but are not limited to: county, state and federal emergency management officials, local law enforcement officials, Skywarn spotters, NWS damage surveys, newspaper clipping services, the insurance industry and the general public. From the data, I found that the most harmful natural disaster is Tornado which brought 256 incidents respect to population health, 3212258.16 USD property damage. Also, hail appeared to be the most harmful for crops, for the stated period of time hail brought 579596.28 USD of harm.
From the https://www.coursera.org/learn/reproducible-research/peer/OMZ37/course-project-2 I obtained the data of an official publication of the National Oceanic and Atmospheric Administration (NOAA) which documents: a. The occurrence of storms and other significant weather phenomena having sufficient intensity to cause loss of life, injuries, significant property damage, and/or disruption to commerce; b. Rare, unusual, weather phenomena that generate media attention, such as snow flurries in South Florida or the San Diego coastal area; and c. Other significant meteorological events, such as record maximum or minimum temperatures or precipitation that occur in connection with another event.
First we read in the data from the raw comma separated value file included in the zip archive, which we unzipped and loaded to the R-mark down document.
StormData <- read.csv("~/MyProjects/representative projects/week4/repdata%2Fdata%2FStormData (1).csv")
After reading in the dataset, I run a quick structural summary of the dataset.
str(StormData)
## 'data.frame': 902297 obs. of 37 variables:
## $ STATE__ : num 1 1 1 1 1 1 1 1 1 1 ...
## $ BGN_DATE : Factor w/ 16335 levels "1/1/1966 0:00:00",..: 6523 6523 4242 11116 2224 2224 2260 383 3980 3980 ...
## $ BGN_TIME : Factor w/ 3608 levels "00:00:00 AM",..: 272 287 2705 1683 2584 3186 242 1683 3186 3186 ...
## $ TIME_ZONE : Factor w/ 22 levels "ADT","AKS","AST",..: 7 7 7 7 7 7 7 7 7 7 ...
## $ COUNTY : num 97 3 57 89 43 77 9 123 125 57 ...
## $ COUNTYNAME: Factor w/ 29601 levels "","5NM E OF MACKINAC BRIDGE TO PRESQUE ISLE LT MI",..: 13513 1873 4598 10592 4372 10094 1973 23873 24418 4598 ...
## $ STATE : Factor w/ 72 levels "AK","AL","AM",..: 2 2 2 2 2 2 2 2 2 2 ...
## $ EVTYPE : Factor w/ 985 levels " HIGH SURF ADVISORY",..: 834 834 834 834 834 834 834 834 834 834 ...
## $ BGN_RANGE : num 0 0 0 0 0 0 0 0 0 0 ...
## $ BGN_AZI : Factor w/ 35 levels ""," N"," NW",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ BGN_LOCATI: Factor w/ 54429 levels ""," Christiansburg",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ END_DATE : Factor w/ 6663 levels "","1/1/1993 0:00:00",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ END_TIME : Factor w/ 3647 levels ""," 0900CST",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ COUNTY_END: num 0 0 0 0 0 0 0 0 0 0 ...
## $ COUNTYENDN: logi NA NA NA NA NA NA ...
## $ END_RANGE : num 0 0 0 0 0 0 0 0 0 0 ...
## $ END_AZI : Factor w/ 24 levels "","E","ENE","ESE",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ END_LOCATI: Factor w/ 34506 levels ""," CANTON"," TULIA",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ LENGTH : num 14 2 0.1 0 0 1.5 1.5 0 3.3 2.3 ...
## $ WIDTH : num 100 150 123 100 150 177 33 33 100 100 ...
## $ F : int 3 2 2 2 2 2 2 1 3 3 ...
## $ MAG : num 0 0 0 0 0 0 0 0 0 0 ...
## $ FATALITIES: num 0 0 0 0 0 0 0 0 1 0 ...
## $ INJURIES : num 15 0 2 2 2 6 1 0 14 0 ...
## $ PROPDMG : num 25 2.5 25 2.5 2.5 2.5 2.5 2.5 25 25 ...
## $ PROPDMGEXP: Factor w/ 19 levels "","-","?","+",..: 17 17 17 17 17 17 17 17 17 17 ...
## $ CROPDMG : num 0 0 0 0 0 0 0 0 0 0 ...
## $ CROPDMGEXP: Factor w/ 9 levels "","?","0","2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ WFO : Factor w/ 542 levels ""," CI","%SD",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ STATEOFFIC: Factor w/ 250 levels "","ALABAMA, Central",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ ZONENAMES : Factor w/ 25112 levels ""," "| __truncated__,..: 1 1 1 1 1 1 1 1 1 1 ...
## $ LATITUDE : num 3040 3042 3340 3458 3412 ...
## $ LONGITUDE : num 8812 8755 8742 8626 8642 ...
## $ LATITUDE_E: num 3051 0 0 0 0 ...
## $ LONGITUDE_: num 8806 0 0 0 0 ...
## $ REMARKS : Factor w/ 436781 levels "","\t","\t\t",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ REFNUM : num 1 2 3 4 5 6 7 8 9 10 ...
After running head and tail function, we get the idea of the first and last days of records in the dataset which are between 4/18/1950 and 11/28/2011
head(StormData[, 1:13])
## STATE__ BGN_DATE BGN_TIME TIME_ZONE COUNTY COUNTYNAME STATE
## 1 1 4/18/1950 0:00:00 0130 CST 97 MOBILE AL
## 2 1 4/18/1950 0:00:00 0145 CST 3 BALDWIN AL
## 3 1 2/20/1951 0:00:00 1600 CST 57 FAYETTE AL
## 4 1 6/8/1951 0:00:00 0900 CST 89 MADISON AL
## 5 1 11/15/1951 0:00:00 1500 CST 43 CULLMAN AL
## 6 1 11/15/1951 0:00:00 2000 CST 77 LAUDERDALE AL
## EVTYPE BGN_RANGE BGN_AZI BGN_LOCATI END_DATE END_TIME
## 1 TORNADO 0
## 2 TORNADO 0
## 3 TORNADO 0
## 4 TORNADO 0
## 5 TORNADO 0
## 6 TORNADO 0
tail(StormData)
## STATE__ BGN_DATE BGN_TIME TIME_ZONE COUNTY
## 902292 47 11/28/2011 0:00:00 03:00:00 PM CST 21
## 902293 56 11/30/2011 0:00:00 10:30:00 PM MST 7
## 902294 30 11/10/2011 0:00:00 02:48:00 PM MST 9
## 902295 2 11/8/2011 0:00:00 02:58:00 PM AKS 213
## 902296 2 11/9/2011 0:00:00 10:21:00 AM AKS 202
## 902297 1 11/28/2011 0:00:00 08:00:00 PM CST 6
## COUNTYNAME STATE EVTYPE BGN_RANGE
## 902292 TNZ001>004 - 019>021 - 048>055 - 088 TN WINTER WEATHER 0
## 902293 WYZ007 - 017 WY HIGH WIND 0
## 902294 MTZ009 - 010 MT HIGH WIND 0
## 902295 AKZ213 AK HIGH WIND 0
## 902296 AKZ202 AK BLIZZARD 0
## 902297 ALZ006 AL HEAVY SNOW 0
## BGN_AZI BGN_LOCATI END_DATE END_TIME COUNTY_END
## 902292 11/29/2011 0:00:00 12:00:00 PM 0
## 902293 11/30/2011 0:00:00 10:30:00 PM 0
## 902294 11/10/2011 0:00:00 02:48:00 PM 0
## 902295 11/9/2011 0:00:00 01:15:00 PM 0
## 902296 11/9/2011 0:00:00 05:00:00 PM 0
## 902297 11/29/2011 0:00:00 04:00:00 AM 0
## COUNTYENDN END_RANGE END_AZI END_LOCATI LENGTH WIDTH F MAG
## 902292 NA 0 0 0 NA 0
## 902293 NA 0 0 0 NA 66
## 902294 NA 0 0 0 NA 52
## 902295 NA 0 0 0 NA 81
## 902296 NA 0 0 0 NA 0
## 902297 NA 0 0 0 NA 0
## FATALITIES INJURIES PROPDMG PROPDMGEXP CROPDMG CROPDMGEXP WFO
## 902292 0 0 0 K 0 K MEG
## 902293 0 0 0 K 0 K RIW
## 902294 0 0 0 K 0 K TFX
## 902295 0 0 0 K 0 K AFG
## 902296 0 0 0 K 0 K AFG
## 902297 0 0 0 K 0 K HUN
## STATEOFFIC
## 902292 TENNESSEE, West
## 902293 WYOMING, Central and West
## 902294 MONTANA, Central
## 902295 ALASKA, Northern
## 902296 ALASKA, Northern
## 902297 ALABAMA, North
## ZONENAMES
## 902292 LAKE - LAKE - OBION - WEAKLEY - HENRY - DYER - GIBSON - CARROLL - LAUDERDALE - TIPTON - HAYWOOD - CROCKETT - MADISON - CHESTER - HENDERSON - DECATUR - SHELBY
## 902293 OWL CREEK & BRIDGER MOUNTAINS - OWL CREEK & BRIDGER MOUNTAINS - WIND RIVER BASIN
## 902294 NORTH ROCKY MOUNTAIN FRONT - NORTH ROCKY MOUNTAIN FRONT - EASTERN GLACIER
## 902295 ST LAWRENCE IS. BERING STRAIT - ST LAWRENCE IS. BERING STRAIT
## 902296 NORTHERN ARCTIC COAST - NORTHERN ARCTIC COAST
## 902297 MADISON - MADISON
## LATITUDE LONGITUDE LATITUDE_E LONGITUDE_
## 902292 0 0 0 0
## 902293 0 0 0 0
## 902294 0 0 0 0
## 902295 0 0 0 0
## 902296 0 0 0 0
## 902297 0 0 0 0
## REMARKS
## 902292 EPISODE NARRATIVE: A powerful upper level low pressure system brought snow to portions of Northeast Arkansas, the Missouri Bootheel, West Tennessee and extreme north Mississippi. Most areas picked up between 1 and 3 inches of with areas of Northeast Arkansas and the Missouri Bootheel receiving between 4 and 6 inches of snow.EVENT NARRATIVE: Around 1 inch of snow fell in Carroll County.
## 902293 EPISODE NARRATIVE: A strong cold front moved south through north central Wyoming bringing high wind to the Meeteetse area and along the south slopes of the western Owl Creek Range. Wind gusts to 76 mph were recorded at Madden Reservoir.EVENT NARRATIVE:
## 902294 EPISODE NARRATIVE: A strong westerly flow aloft produced gusty winds at the surface along the Rocky Mountain front and over the plains of Central Montana. Wind gusts in excess of 60 mph were reported.EVENT NARRATIVE: A wind gust to 60 mph was reported at East Glacier Park 1ENE (the Two Medicine DOT site).
## 902295 EPISODE NARRATIVE: A 960 mb low over the southern Aleutians at 0300AKST on the 8th intensified to 945 mb near the Gulf of Anadyr by 2100AKST on the 8th. The low crossed the Chukotsk Peninsula as a 956 mb low at 0900AKST on the 9th, and moved into the southern Chukchi Sea as a 958 mb low by 2100AKST on the 9th. The low then tracked to the northwest and weakened to 975 mb about 150 miles north of Wrangel Island by 1500AKST on the 10th. The storm was one of the strongest storms to impact the west coast of Alaska since November 1974. \n\nZone 201: Blizzard conditions were observed at Wainwright from approximately 1153AKST through 1611AKST on the 9th. The visibility was frequently reduced to one quarter mile in snow and blowing snow. There was a peak wind gust to 43kt (50 mph) at the Wainwright ASOS. During this event, there was also a peak wind gust to \n68 kt (78 mph) at the Cape Lisburne AWOS. \n\nZone 202: Blizzard conditions were observed at Barrow from approximately 1021AKST through 1700AKST on the 9th. The visibility was frequently reduced to one quarter mile or less in blowing snow. There was a peak wind gust to 46 kt (53 mph) at the Barrow ASOS. \n\nZone 207: Blizzard conditions were observed at Kivalina from approximately 0400AKST through 1230AKST on the 9th. The visibility was frequently reduced to one quarter of a mile in snow and blowing snow. There was a peak wind gust to 61 kt (70 mph) at the Kivalina ASOS. The doors to the village transportation shed were blown out to sea. Many homes lost portions of their tin roofing, and satellite dishes were ripped off of roofs. One home had its door blown off. At Point Hope, severe blizzard conditions were observed. There was a peak wind gust of 68 kt (78 mph) at the Point Hope AWOS before power was lost to the AWOS. It was estimated that the wind gusted as high as 85 mph in the village during the height of the storm during the morning and early afternoon hours on the 9th. Five power poles were knocked down in the storm EVENT NARRATIVE:
## 902296 EPISODE NARRATIVE: A 960 mb low over the southern Aleutians at 0300AKST on the 8th intensified to 945 mb near the Gulf of Anadyr by 2100AKST on the 8th. The low crossed the Chukotsk Peninsula as a 956 mb low at 0900AKST on the 9th, and moved into the southern Chukchi Sea as a 958 mb low by 2100AKST on the 9th. The low then tracked to the northwest and weakened to 975 mb about 150 miles north of Wrangel Island by 1500AKST on the 10th. The storm was one of the strongest storms to impact the west coast of Alaska since November 1974. \n\nZone 201: Blizzard conditions were observed at Wainwright from approximately 1153AKST through 1611AKST on the 9th. The visibility was frequently reduced to one quarter mile in snow and blowing snow. There was a peak wind gust to 43kt (50 mph) at the Wainwright ASOS. During this event, there was also a peak wind gust to \n68 kt (78 mph) at the Cape Lisburne AWOS. \n\nZone 202: Blizzard conditions were observed at Barrow from approximately 1021AKST through 1700AKST on the 9th. The visibility was frequently reduced to one quarter mile or less in blowing snow. There was a peak wind gust to 46 kt (53 mph) at the Barrow ASOS. \n\nZone 207: Blizzard conditions were observed at Kivalina from approximately 0400AKST through 1230AKST on the 9th. The visibility was frequently reduced to one quarter of a mile in snow and blowing snow. There was a peak wind gust to 61 kt (70 mph) at the Kivalina ASOS. The doors to the village transportation shed were blown out to sea. Many homes lost portions of their tin roofing, and satellite dishes were ripped off of roofs. One home had its door blown off. At Point Hope, severe blizzard conditions were observed. There was a peak wind gust of 68 kt (78 mph) at the Point Hope AWOS before power was lost to the AWOS. It was estimated that the wind gusted as high as 85 mph in the village during the height of the storm during the morning and early afternoon hours on the 9th. Five power poles were knocked down in the storm EVENT NARRATIVE:
## 902297 EPISODE NARRATIVE: An intense upper level low developed on the 28th at the base of a highly amplified upper trough across the Great Lakes and Mississippi Valley. The upper low closed off over the mid South and tracked northeast across the Tennessee Valley during the morning of the 29th. A warm conveyor belt of heavy rainfall developed in advance of the low which dumped from around 2 to over 5 inches of rain across the eastern two thirds of north Alabama and middle Tennessee. The highest rain amounts were recorded in Jackson and DeKalb Counties with 3 to 5 inches. The rain fell over 24 to 36 hour period, with rainfall remaining light to moderate during most its duration. The rainfall resulted in minor river flooding along the Little River, Big Wills Creek and Paint Rock. A landslide occurred on Highway 35 just north of Section in Jackson County. A driver was trapped in his vehicle, but was rescued unharmed. Trees, boulders and debris blocked 100 to 250 yards of Highway 35.\n\nThe rain mixed with and changed to snow across north Alabama during the afternoon and evening hours of the 28th, and lasted into the 29th. The heaviest bursts of snow occurred in northwest Alabama during the afternoon and evening hours, and in north central and northeast Alabama during the overnight and morning hours. Since ground temperatures were in the 50s, and air temperatures in valley areas only dropped into the mid 30s, most of the snowfall melted on impact with mostly trace amounts reported in valley locations. However, above 1500 foot elevation, snow accumulations of 1 to 2 inches were reported. The heaviest amount was 2.3 inches on Monte Sano Mountain, about 5 miles northeast of Huntsville.EVENT NARRATIVE: Snowfall accumulations of up to 2.3 inches were reported on the higher elevations of eastern Madison County. A snow accumulation of 1.5 inches was reported 2.7 miles south of Gurley, while 2.3 inches was reported 3 miles east of Huntsville atop Monte Sano Mountain.
## REFNUM
## 902292 902292
## 902293 902293
## 902294 902294
## 902295 902295
## 902296 902296
## 902297 902297
I load the dplyr library package to use some helpful functions from that package
##
## 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
To familiarize myself with the range of natural disasters, ever fixed for the timeframe, I run table, dim, sum commands and see there are plenty of different natural events - 985 which occurred 902297 times.
StormData$EVTYPE <- factor(StormData$EVTYPE)
ET<-table(StormData$EVTYPE)
dim(ET)
## [1] 985
sum(ET)
## [1] 902297
Next, I run sort and tail function to find out which disasters appeared the most number of times for the given period.
tops<-sort(ET)
tail(tops)
##
## FLOOD FLASH FLOOD TORNADO THUNDERSTORM WIND
## 25326 54277 60652 82563
## TSTM WIND HAIL
## 219940 288661
As the next step, I convert EVTYPE variable from factor variable to character to make my plotting and groupping work possible.
StormData$Evtype <- as.character(StormData$EVTYPE)
class(StormData$Evtype)
## [1] "character"
Here I do some data manipulation as selecting and filtering Null values which indicate that this type of disaster did not bring any harm. After that, I group the total number of harms by the type of the disaster to find out which natural event is the most harmful to people.
Evtype_Injuries<-StormData%>%
select(Evtype, FATALITIES, INJURIES)%>%
group_by(Evtype) %>%
summarise(health_affects = sum(FATALITIES) + sum(INJURIES))
Evtype_Injuries
## # A tibble: 985 x 2
## Evtype health_affects
## <chr> <dbl>
## 1 HIGH SURF ADVISORY 0
## 2 COASTAL FLOOD 0
## 3 FLASH FLOOD 0
## 4 LIGHTNING 0
## 5 TSTM WIND 0
## 6 TSTM WIND (G45) 0
## 7 WATERSPOUT 0
## 8 WIND 0
## 9 ? 0
## 10 ABNORMAL WARMTH 0
## # ... with 975 more rows
To get he clear picture of whar was happened and get the rank of the harms, I order the helth_affects results in descenting order. And we get the results, that Excessive heat and Tornado brought the most amount of health harm to the population.
EvtypeInjuries<-Evtype_Injuries[with(Evtype_Injuries, order(desc(health_affects))), ]
EvtypeInjuries
## # A tibble: 985 x 2
## Evtype health_affects
## <chr> <dbl>
## 1 TORNADO 96979
## 2 EXCESSIVE HEAT 8428
## 3 TSTM WIND 7461
## 4 FLOOD 7259
## 5 LIGHTNING 6046
## 6 HEAT 3037
## 7 FLASH FLOOD 2755
## 8 ICE STORM 2064
## 9 THUNDERSTORM WIND 1621
## 10 WINTER STORM 1527
## # ... with 975 more rows
I pick top 30 natural events to plot them and visually compare.
top30Events <- EvtypeInjuries[1:30,]
library(ggplot2)
Building the barplot, we visualize the number of injured and dead by top 30 natural dizasters.
ggplot(top30Events, aes(x=reorder(Evtype, -health_affects), y=health_affects))+geom_bar(stat = "identity", fill="navy") +labs(title = "Health harmness by top 15 natural dizasters", x = "Type of Dizaster", y = "Number of injured and dead")+ theme(axis.text.x = element_text( color="black", size=5, angle=90))
To begin with, I do the same data manipulation as in the previous case: grouping the total amount of Property damages Or Crops damages vs natural damage type. At the same step, I order the numbers in descending order to find out the disaster type which brought the biggest value of damages. We can see here, that the Tornado, Flash Flood, Wind are the top-3 disasters for Property damages. And Hail, Flash Flood, and Flood are the top-3 disasters for the Crop Damages.
EconomicEffect<-StormData%>%
select(Evtype, PROPDMG, CROPDMG)%>%
group_by(Evtype)%>%
summarise(PropDMG = sum(PROPDMG), CropDMG = sum(CROPDMG))
EconomicEffect_prop<-EconomicEffect[with(EconomicEffect, order(desc(PropDMG))), ]
EconomicEffect_prop
## # A tibble: 985 x 3
## Evtype PropDMG CropDMG
## <chr> <dbl> <dbl>
## 1 TORNADO 3212258.2 100018.52
## 2 FLASH FLOOD 1420124.6 179200.46
## 3 TSTM WIND 1335965.6 109202.60
## 4 FLOOD 899938.5 168037.88
## 5 THUNDERSTORM WIND 876844.2 66791.45
## 6 HAIL 688693.4 579596.28
## 7 LIGHTNING 603351.8 3580.61
## 8 THUNDERSTORM WINDS 446293.2 18684.93
## 9 HIGH WIND 324731.6 17283.21
## 10 WINTER STORM 132720.6 1978.99
## # ... with 975 more rows
EconomicEffect_crop<-EconomicEffect[with(EconomicEffect, order(desc(CropDMG))), ]
EconomicEffect_crop
## # A tibble: 985 x 3
## Evtype PropDMG CropDMG
## <chr> <dbl> <dbl>
## 1 HAIL 688693.38 579596.28
## 2 FLASH FLOOD 1420124.59 179200.46
## 3 FLOOD 899938.48 168037.88
## 4 TSTM WIND 1335965.61 109202.60
## 5 TORNADO 3212258.16 100018.52
## 6 THUNDERSTORM WIND 876844.17 66791.45
## 7 DROUGHT 4099.05 33898.62
## 8 THUNDERSTORM WINDS 446293.18 18684.93
## 9 HIGH WIND 324731.56 17283.21
## 10 HEAVY RAIN 50842.14 11122.80
## # ... with 975 more rows
I pick top 30 natural events to plot them and visually compare.
EconomicEffect<-EconomicEffect[with(EconomicEffect, order(desc(PropDMG)), order(desc(CropDMG))), ]
top30Causes <- EconomicEffect[1:30,]
ggplot(top30Causes, aes(x=reorder(Evtype, -PropDMG), y = PropDMG))+geom_bar(stat = "identity", aes(fill = CropDMG))+labs(title = "Economical harmness by top 15 natural dizasters", x = "Type of Dizaster", y = "Value (USD) of damages")+ theme(axis.text.x = element_text( color="black", size=5, angle=90))