Synopsis

In this paper we explore the following two questions

For population health analysis we look at the events that caused either death or injury, for economic analysis we look at the sum of crop and property damage. Depending on the geographic layout of a region the damage might be due to different weather events e.g. the northern regions may have more issues due to cold, snow etc. where as the coastal regions will have issues with tsunami, tidal waves, coastal flooding etc. the inner plains may have damages due to wind or flooding.

We try in this analysis to determing which are the most dangerous conditions for each state so that the state resources can be devoted to planning for those conditions.

Data Processing

Setup environment

Download load and examine the dataset

if(!file.exists("data.csv.bz")){
download.file("https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2","data.csv.bz")
}
data<-read.csv(bzfile("data.csv.bz"))

As a part of the data cleaning we will do the following steps

  • Find the multiplier for the damage section
  • Identify typo’s or similar events and cluster them as same event.
data_tidy<-data %>% 
  mutate(BGN_DATE=mdy_hms(BGN_DATE)) %>%
  filter(FATALITIES>0 |INJURIES>0 | PROPDMG>0 | CROPDMG >0) %>%
mutate(PROPDMG_multiplier=ifelse(PROPDMGEXP=="B",1000000000,
ifelse(PROPDMGEXP=="b",1000000000,
ifelse(PROPDMGEXP=="m",1000000,
ifelse(PROPDMGEXP=="M",1000000,
ifelse(PROPDMGEXP=="K",1000,
ifelse(PROPDMGEXP=="k",1000,
ifelse(PROPDMGEXP=="h",100,
ifelse(PROPDMGEXP=="H",100,
ifelse(PROPDMGEXP=="-",0,
ifelse(PROPDMGEXP=="?",0,
ifelse(PROPDMGEXP=="+",0,
ifelse(PROPDMGEXP==" ",0,
ifelse(PROPDMGEXP=="",0,
10^extract_numeric(PROPDMGEXP))))))))))))))) %>%

mutate(CROPDMG_multiplier=ifelse(PROPDMGEXP=="B",1000000000,
ifelse(CROPDMGEXP=="b",1000000000,
ifelse(CROPDMGEXP=="m",1000000,
ifelse(CROPDMGEXP=="M",1000000,
ifelse(CROPDMGEXP=="K",1000,
ifelse(CROPDMGEXP=="k",1000,
ifelse(CROPDMGEXP=="h",100,
ifelse(CROPDMGEXP=="H",100,
ifelse(CROPDMGEXP=="-",0,
ifelse(CROPDMGEXP=="?",0,
ifelse(CROPDMGEXP=="+",0,
ifelse(CROPDMGEXP==" ",0,
ifelse(CROPDMGEXP=="",0,
10^extract_numeric(CROPDMGEXP))))))))))))))) %>%
  mutate (PROPDMG=PROPDMG*PROPDMG_multiplier,CROPDMG=CROPDMG*CROPDMG_multiplier)%>%

    mutate(EVTYPE=sub("S$","",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub("\\.$","",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub("coast.*flood.*","Coastal Flooding",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".* cold.*","Cold",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub("cold.*","Cold",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub("hypothermia.*","Cold",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub("^flood.*","Flood",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*flash.*flood.*","Flood",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*river.*flood.*","Flood",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*rapidly.*rising.*","Flood",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*wind.*","Wind",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*heat.*","Heat",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*freezing.*","Freezing Rain",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*hurricane.*","Hurricane",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*slide.*","Landslide",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*surf.*","High Surf",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*gusty.*","Gusty Winds",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*[ /]sea.*","High Sea",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*thunder.*","Thunderstorm",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*tstm.*","Thunderstorm",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*high wind.*","High Wind",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*Tornado.*","Tornado",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*Trop.*","Tropical Storm",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*snow.*","Snow",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*winter w.*","Winter Weather",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*wintry.*","Winter Weather",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*fire.*","WildFire",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*hail.*","Hail",EVTYPE,ignore.case=T,perl=T))%>%
    mutate(EVTYPE=sub(".*lightning.*","Lightning",EVTYPE,ignore.case=T,perl=T))%>%
  mutate(EVTYPE=sub("AVAL.*","AVALANCHE",EVTYPE))
  filtered_events<-data_tidy %>%
  group_by(EVTYPE) %>%
    summarise(Total_Fatalities=sum(FATALITIES),Total_Injuries=sum(INJURIES),Total_PropDMG=sum(PROPDMG),Total_CROPDMG=sum(CROPDMG)) 
  
    fatal_events<-filtered_events%>%filter(Total_Fatalities>0) %>%arrange(desc(Total_Fatalities))%>% select(EVTYPE,Total_Fatalities)
    injury_events<-filtered_events%>%filter(Total_Injuries>0) %>%arrange(desc(Total_Injuries))%>% select(EVTYPE,Total_Injuries)

    propdmg_events<-filtered_events%>%filter(Total_PropDMG>0) %>%arrange(desc(Total_PropDMG))%>% select(EVTYPE,Total_PropDMG)
    
    
    cropdmg_events<-filtered_events%>%filter(Total_CROPDMG>0) %>%arrange(desc(Total_CROPDMG))%>% select(EVTYPE,Total_CROPDMG)

The Top 5 events resulting in fatalities are

    print(xtable(head(fatal_events,5)),type="html")
EVTYPE Total_Fatalities
1 Tornado 5636.00
2 Heat 3138.00
3 Flood 1518.00
4 Wind 1230.00
5 Lightning 817.00

Data tells us that maximum fatalities are caused due to Strong wind(Tornado, hurricane, string winds etc.) related events followed by Heat.

The Top 5 events resulting in Injuries are

    print(xtable(head(injury_events,5)),type="html")
EVTYPE Total_Injuries
1 Tornado 91407.00
2 Wind 11462.00
3 Heat 9224.00
4 Flood 8596.00
5 Lightning 5231.00

Data here tells us that strong wind related events cause maximum Injuries

the top 5 events resulting in property damage are

    print(xtable(head(propdmg_events,5)),type="html")
EVTYPE Total_PropDMG
1 Flood 167609307178.50
2 Hurricane 84656180010.00
3 Tornado 57003317813.50
4 STORM SURGE 43323536000.00
5 Wind 17940575993.10

Maixmum property damage is caused due to flooding followed by hurricane and other wind conditions.

the top 5 events resulting in crop damage are

    print(xtable(head(cropdmg_events,5)),type="html")
EVTYPE Total_CROPDMG
1 Hurricane 1538470792800.00
2 Flood 45840854100.00
3 Wind 14533354530.00
4 WildFire 6896781630.00
5 Hail 3046837470.00

Maximum crop damage is caused by hurricane followed by flooding.

Results

Exploratory graphs for different incidents per state

    ggplot(data_tidy,aes(x=STATE,y=FATALITIES))+geom_point()

    ggplot(data_tidy,aes(x=STATE,y=INJURIES))+geom_point()

National Disaster Plan

A National Disaster plan would require identification of suseptability of the counties and states to different risk types. e.g. A non-costal interior state will not be suseptible to Tsunami and need not account for it during its disaster prepardness program. Similarly a tropical state need not consider snow and related issues.

The following counties in the country are the most suseptible to events leading to loss of life

    risky_counties<-data_tidy%>% group_by(COUNTYNAME)%>% summarize(Total_Fatalities=sum(FATALITIES),Total_Injuries=sum(INJURIES),Total_PropDMG=sum(PROPDMG),Total_CROPDMG=sum(CROPDMG))
    
    fatal_events<-risky_counties%>%filter(Total_Fatalities>0) %>%arrange(desc(Total_Fatalities))%>% select(COUNTYNAME,Total_Fatalities)
    injury_events<-risky_counties%>%filter(Total_Injuries>0) %>%arrange(desc(Total_Injuries))%>% select(COUNTYNAME,Total_Injuries)

    propdmg_events<-risky_counties%>%filter(Total_PropDMG>0) %>%arrange(desc(Total_PropDMG))%>% select(COUNTYNAME,Total_PropDMG)
    
    
    cropdmg_events<-risky_counties%>%filter(Total_CROPDMG>0) %>%arrange(desc(Total_CROPDMG))%>% select(COUNTYNAME,Total_CROPDMG)

The Top 5 events resulting in fatalities are

    print(xtable(head(fatal_events,5)),type="html")
COUNTYNAME Total_Fatalities
1 ILZ003>006 - 008 - 010>014 - 019>023 - 032 - 033 - 039 585.00
2 ILZ014 290.00
3 JASPER 175.00
4 JEFFERSON 174.00
5 PAZ054>055 - 060>062 - 067>071 165.00

The Top 5 events resulting in Injuries are

    print(xtable(head(injury_events,5)),type="html")
COUNTYNAME Total_Injuries
1 JEFFERSON 2554.00
2 GREENE 1865.00
3 WICHITA 1856.00
4 MADISON 1621.00
5 OHZ42>088 1568.00

the top 5 events resulting in property damage are

    print(xtable(head(propdmg_events,5)),type="html")
COUNTYNAME Total_PropDMG
1 NAPA 115116385000.00
2 LAZ040 - 059 - 061>064 - 067>070 31300000000.00
3 LAZ034>040 - 046>050 - 056>070 17079580000.00
4 MSZ080>082 11264135000.00
5 FLZ068>069 - 072 - 074 10000325000.00

the top 5 events resulting in crop damage are

    print(xtable(head(cropdmg_events,5)),type="html")
COUNTYNAME Total_CROPDMG
1 NCZ007>011 - 021>028 - 038>043 - 073>078 - 083>086 - 088>089 500003000000.00
2 FLZ001>006 325000000000.00
3 PRZ005 - 013 - 069 - 097 - 113 - 123 - 127 301014000000.00
4 FLZ055 - 060>062 - 065 285000000000.00
5 FLZ041 - 047 - 054 - 059 - 064 93208700000.00
    risky_state<-data_tidy%>%
      group_by(STATE,EVTYPE)%>%
      summarize(Total_Fatalities=sum(FATALITIES),Total_Injuries=sum(INJURIES),Total_PropDMG=sum(PROPDMG),Total_CROPDMG=sum(CROPDMG)) %>%
      ungroup() %>%
      group_by(STATE) %>%
      filter(Total_Fatalities>10) %>%
     arrange(desc(Total_Fatalities))

We now print a table of the top 2 events in each state which resulted in the highest number of fatalities greater than 10.

    print(xtable(top_n(risky_state,2,Total_Fatalities) ),type="html")
STATE EVTYPE Total_Fatalities Total_Injuries Total_PropDMG Total_CROPDMG
1 AK AVALANCHE 33.00 17.00 869000.00 0.00
2 AL Tornado 617.00 7929.00 6321297560.00 56797500.00
3 AL Wind 48.00 451.00 304547150.00 10011402500.00
4 AN Wind 12.00 22.00 274000.00 0.00
5 AR Tornado 379.00 5116.00 2590007310.00 1507010.00
6 AR Flood 61.00 42.00 634407580.00 150090000.00
7 AS TSUNAMI 32.00 129.00 81000000.00 20000.00
8 AZ Flood 63.00 158.00 120458600.00 13505000.00
9 AZ Heat 58.00 0.00 0.00 0.00
10 CA Heat 118.00 265.00 180000.00 492402000.00
11 CA Flood 68.00 80.00 117116411000.00 33279944000.00
12 CO AVALANCHE 48.00 35.00 491800.00 0.00
13 CO Lightning 48.00 260.00 16895688.00 93400.00
14 CT Wind 14.00 82.00 23446600.00 0.00
15 DC Heat 22.00 316.00 0.00 0.00
16 FL RIP CURRENT 271.00 247.00 0.00 0.00
17 FL Tornado 161.00 3344.00 1752331590.00 153500.00
18 GA Tornado 180.00 3926.00 3261026670.00 10785500.00
19 GA Wind 44.00 416.00 446731435.00 78657800.00
20 GU RIP CURRENT 38.00 55.00 42000.00 0.00
21 GU HEAVY RAIN 19.00 8.00 2020000.00 0.00
22 HI High Surf 28.00 32.00 14850500.00 1500000.00
23 IA Tornado 81.00 2208.00 2286576200.00 5611110.00
24 IA Wind 14.00 318.00 400063430.00 155253330.00
25 ID AVALANCHE 16.00 9.00 36000.00 0.00
26 ID Wind 13.00 178.00 28003100.00 6041000.00
27 IL Heat 983.00 594.00 55000.00 460000.00
28 IL Tornado 203.00 4145.00 1780614040.00 2298300.00
29 IN Tornado 252.00 4224.00 2594793890.00 516000.00
30 IN Flood 43.00 13.00 1167733650.00 790916500.00
31 KS Tornado 236.00 2721.00 2669890670.00 12275000.00
32 KS Flood 24.00 23.00 547780350.00 108071000.00
33 KY Tornado 125.00 2806.00 888768680.00 1908000.00
34 KY Flood 59.00 27.00 790311000.00 39120500.00
35 LA Tornado 156.00 2676.00 1229367890.00 3843000.00
36 LA Heat 62.00 3.00 110000.00 0.00
37 MA Tornado 108.00 1758.00 756039145.00 0.00
38 MA Wind 16.00 151.00 57680690.00 1262000.00
39 MD Heat 100.00 545.00 30000.00 4705780.00
40 MD Flood 13.00 29.00 148993000.00 1385000.00
41 MD Lightning 13.00 73.00 24740600.00 6000.00
42 MI Tornado 243.00 3362.00 1071765550.00 1513000.00
43 MI Wind 55.00 384.00 434489650.00 49613000.00
44 MN Tornado 99.00 1976.00 1903701140.00 13196050.00
45 MN Flood 18.00 40.00 1557228400.00 115991500.00
46 MO Tornado 388.00 4330.00 4800701725.00 22266000.00
47 MO Heat 233.00 4185.00 469000.00 875000.00
48 MS Tornado 450.00 6246.00 2442464530.00 54135000.00
49 MS Heat 26.00 5.00 0.00 76500.00
50 MT Wind 12.00 51.00 42984100.00 15431000.00
51 NC Tornado 126.00 2548.00 1551933680.00 4437000.00
52 NC Flood 66.00 25.00 1044989050.00 274506900.00
53 ND Tornado 25.00 326.00 172766270.00 11735000.00
54 NE Tornado 54.00 1158.00 1718164710.00 27545750.00
55 NE WINTER STORM 11.00 22.00 52094000.00 4720000.00
56 NH Wind 14.00 54.00 18785500.00 0.00
57 NJ Heat 48.00 304.00 0.00 0.00
58 NJ Wind 31.00 301.00 93692800.00 1200000.00
59 NM Flood 18.00 18.00 81007500.00 5381000.00
60 NM Cold 12.00 1.00 925000.00 0.00
61 NM Lightning 12.00 52.00 711500.00 0.00
62 NV Heat 67.00 0.00 0.00 0.00
63 NV Wind 12.00 61.00 72060600.00 120050.00
64 NY Heat 100.00 51.00 0.00 0.00
65 NY Wind 70.00 469.00 633205470.00 12394000.00
66 OH Tornado 191.00 4442.00 2283157790.00 5383500.00
67 OH Wind 61.00 399.00 892370200.00 17349000.00
68 OK Tornado 296.00 4829.00 3268708233.00 50556550.00
69 OK Heat 87.00 219.00 10000.00 0.00
70 OR Wind 21.00 68.00 116853150.00 6110000.00
71 OR Flood 16.00 13.00 723562500.00 18860000.00
72 PA Heat 514.00 381.00 205000.00 50000.00
73 PA Flood 86.00 164.00 2522659509.00 4505000.00
74 PR Flood 42.00 4.00 313444650.00 60570000.00
75 PR Hurricane 19.00 1.00 1824431000.00 301150000000.00
76 SC Tornado 59.00 1314.00 531745190.00 5266050.00
77 SC Heat 41.00 20.00 0.00 0.00
78 SD Tornado 18.00 452.00 231213780.00 640100.00
79 SD Wind 11.00 165.00 91136950.00 22487100.00
80 TN Tornado 368.00 4748.00 1541799890.00 2679000.00
81 TN Flood 58.00 45.00 4764747170.00 1005867000.00
82 TX Tornado 538.00 8207.00 3720875840.00 81889100.00
83 TX Heat 298.00 787.00 200000.00 50000.00
84 UT AVALANCHE 44.00 25.00 70000.00 0.00
85 UT Lightning 22.00 50.00 1435800.00 50000.00
86 VA Flood 47.00 16.00 401930947.00 92610550.00
87 VA Tornado 36.00 914.00 439239250.00 2156000.00
88 WA Wind 50.00 106.00 164900700.00 37695000.00
89 WA AVALANCHE 35.00 36.00 2100000.00 0.00
90 WI Heat 98.00 149.00 37000.00 0.00
91 WI Tornado 96.00 1601.00 958093080.00 16513700.00
92 WV Flood 42.00 12.00 786398100.00 2400000.00
93 WV Wind 13.00 160.00 38065750.00 850100.00
94 WY AVALANCHE 23.00 21.00 15000.00 0.00

We now print a table of the top 2 events in each state which resulted in the highest number of injuries greater than 10.

    print(xtable(top_n(risky_state,2,Total_Injuries) ),type="html")
STATE EVTYPE Total_Fatalities Total_Injuries Total_PropDMG Total_CROPDMG
1 AK AVALANCHE 33.00 17.00 869000.00 0.00
2 AL Tornado 617.00 7929.00 6321297560.00 56797500.00
3 AL Wind 48.00 451.00 304547150.00 10011402500.00
4 AN Wind 12.00 22.00 274000.00 0.00
5 AR Tornado 379.00 5116.00 2590007310.00 1507010.00
6 AR Wind 28.00 245.00 126465710.00 100000.00
7 AS TSUNAMI 32.00 129.00 81000000.00 20000.00
8 AZ Wind 20.00 212.00 504466300.00 165000.00
9 AZ DUST STORM 15.00 179.00 2238000.00 0.00
10 CA WildFire 39.00 1128.00 5033787830.00 6634460000.00
11 CA FOG 23.00 408.00 8751000.00 0.00
12 CO Lightning 48.00 260.00 16895688.00 93400.00
13 CO Wind 13.00 160.00 70890603.00 18156000.00
14 CT Wind 14.00 82.00 23446600.00 0.00
15 DC Heat 22.00 316.00 0.00 0.00
16 FL Tornado 161.00 3344.00 1752331590.00 153500.00
17 FL Lightning 123.00 859.00 83919350.00 81000.00
18 GA Tornado 180.00 3926.00 3261026670.00 10785500.00
19 GA Wind 44.00 416.00 446731435.00 78657800.00
20 GU RIP CURRENT 38.00 55.00 42000.00 0.00
21 GU HEAVY RAIN 19.00 8.00 2020000.00 0.00
22 GU High Surf 16.00 8.00 0.00 0.00
23 HI High Surf 28.00 32.00 14850500.00 1500000.00
24 IA Tornado 81.00 2208.00 2286576200.00 5611110.00
25 IA Wind 14.00 318.00 400063430.00 155253330.00
26 ID AVALANCHE 16.00 9.00 36000.00 0.00
27 ID Wind 13.00 178.00 28003100.00 6041000.00
28 IL Tornado 203.00 4145.00 1780614040.00 2298300.00
29 IL Wind 37.00 606.00 639799080.00 156490500.00
30 IN Tornado 252.00 4224.00 2594793890.00 516000.00
31 IN Wind 40.00 296.00 127536857.10 3735500.00
32 KS Tornado 236.00 2721.00 2669890670.00 12275000.00
33 KS Wind 19.00 373.00 337778440.00 43432100.00
34 KY Tornado 125.00 2806.00 888768680.00 1908000.00
35 KY Wind 23.00 440.00 362460410.00 17826700.00
36 LA Tornado 156.00 2676.00 1229367890.00 3843000.00
37 LA Wind 34.00 288.00 851129050.00 1712000.00
38 MA Tornado 108.00 1758.00 756039145.00 0.00
39 MA Wind 16.00 151.00 57680690.00 1262000.00
40 MD Heat 100.00 545.00 30000.00 4705780.00
41 MD Lightning 13.00 73.00 24740600.00 6000.00
42 MI Tornado 243.00 3362.00 1071765550.00 1513000.00
43 MI Heat 23.00 594.00 0.00 0.00
44 MN Tornado 99.00 1976.00 1903701140.00 13196050.00
45 MN Flood 18.00 40.00 1557228400.00 115991500.00
46 MO Tornado 388.00 4330.00 4800701725.00 22266000.00
47 MO Heat 233.00 4185.00 469000.00 875000.00
48 MS Tornado 450.00 6246.00 2442464530.00 54135000.00
49 MS Wind 23.00 252.00 269963760.00 13843300.00
50 MT Wind 12.00 51.00 42984100.00 15431000.00
51 NC Tornado 126.00 2548.00 1551933680.00 4437000.00
52 NC Lightning 29.00 278.00 48380000.00 2070000.00
53 ND Tornado 25.00 326.00 172766270.00 11735000.00
54 NE Tornado 54.00 1158.00 1718164710.00 27545750.00
55 NE WINTER STORM 11.00 22.00 52094000.00 4720000.00
56 NH Wind 14.00 54.00 18785500.00 0.00
57 NJ Heat 48.00 304.00 0.00 0.00
58 NJ Wind 31.00 301.00 93692800.00 1200000.00
59 NM Lightning 12.00 52.00 711500.00 0.00
60 NM Wind 11.00 68.00 23457750.00 288000.00
61 NV Heat 67.00 0.00 0.00 0.00
62 NV Wind 12.00 61.00 72060600.00 120050.00
63 NY Wind 70.00 469.00 633205470.00 12394000.00
64 NY Tornado 22.00 315.00 466573840.00 820000.00
65 OH Tornado 191.00 4442.00 2283157790.00 5383500.00
66 OH Wind 61.00 399.00 892370200.00 17349000.00
67 OK Tornado 296.00 4829.00 3268708233.00 50556550.00
68 OK Wind 11.00 329.00 1020753990.00 125000.00
69 OR Wind 21.00 68.00 116853150.00 6110000.00
70 OR Flood 16.00 13.00 723562500.00 18860000.00
71 PA Tornado 82.00 1241.00 1789088400.00 7129000.00
72 PA Wind 46.00 394.00 239904970.00 531500.00
73 PR HEAVY RAIN 13.00 10.00 1680080.00 100000.00
74 PR High Surf 11.00 9.00 2842000.00 0.00
75 SC Tornado 59.00 1314.00 531745190.00 5266050.00
76 SC Wind 29.00 265.00 173193950.00 17324000.00
77 SD Tornado 18.00 452.00 231213780.00 640100.00
78 SD Wind 11.00 165.00 91136950.00 22487100.00
79 TN Tornado 368.00 4748.00 1541799890.00 2679000.00
80 TN Wind 20.00 260.00 201336430.00 11575500.00
81 TX Tornado 538.00 8207.00 3720875840.00 81889100.00
82 TX Flood 254.00 6925.00 2142354150.00 113670000.00
83 UT WINTER STORM 20.00 415.00 11822000.00 298000.00
84 UT Snow 11.00 259.00 54460750.00 72100.00
85 VA Tornado 36.00 914.00 439239250.00 2156000.00
86 VA Wind 25.00 306.00 152791866.00 23020550.00
87 WA Wind 50.00 106.00 164900700.00 37695000.00
88 WA AVALANCHE 35.00 36.00 2100000.00 0.00
89 WI Tornado 96.00 1601.00 958093080.00 16513700.00
90 WI Wind 27.00 266.00 274111050.00 44899750.00
91 WV Flood 42.00 12.00 786398100.00 2400000.00
92 WV Wind 13.00 160.00 38065750.00 850100.00
93 WY AVALANCHE 23.00 21.00 15000.00 0.00

Similarly we print a table for Financial loss

    financial_risk<-risky_state%>% mutate(Total_loss_Millions=(extract_numeric(Total_PropDMG)+extract_numeric(Total_CROPDMG))/1000000)%>%
      filter(Total_loss_Millions>50)%>%
      arrange(desc(extract_numeric(Total_loss_Millions)))
    tbl=xtable(top_n(financial_risk,2,Total_loss_Millions))
          caption( tbl)<-"Top Events causing major financial loss in each States"     
    print(tbl,type="html")
Top Events causing major financial loss in each States
STATE EVTYPE Total_Fatalities Total_Injuries Total_PropDMG Total_CROPDMG Total_loss_Millions
1 AL Wind 48.00 451.00 304547150.00 10011402500.00 10315.95
2 AL Tornado 617.00 7929.00 6321297560.00 56797500.00 6378.10
3 AR Tornado 379.00 5116.00 2590007310.00 1507010.00 2591.51
4 AR Flood 61.00 42.00 634407580.00 150090000.00 784.50
5 AZ Wind 20.00 212.00 504466300.00 165000.00 504.63
6 AZ Flood 63.00 158.00 120458600.00 13505000.00 133.96
7 CA Flood 68.00 80.00 117116411000.00 33279944000.00 150396.36
8 CA WildFire 39.00 1128.00 5033787830.00 6634460000.00 11668.25
9 CO Flood 12.00 63.00 458286857.50 5719000.00 464.01
10 CO Wind 13.00 160.00 70890603.00 18156000.00 89.05
11 FL Hurricane 47.00 812.00 31794496000.00 709239710000.00 741034.21
12 FL Wind 67.00 314.00 4932331780.00 2844228900.00 7776.56
13 GA Tornado 180.00 3926.00 3261026670.00 10785500.00 3271.81
14 GA Flood 43.00 26.00 701386720.00 13941550.00 715.33
15 IA Tornado 81.00 2208.00 2286576200.00 5611110.00 2292.19
16 IA Wind 14.00 318.00 400063430.00 155253330.00 555.32
17 IL Flood 24.00 31.00 6047132810.00 5070459050.00 11117.59
18 IL Tornado 203.00 4145.00 1780614040.00 2298300.00 1782.91
19 IN Tornado 252.00 4224.00 2594793890.00 516000.00 2595.31
20 IN Flood 43.00 13.00 1167733650.00 790916500.00 1958.65
21 KS Tornado 236.00 2721.00 2669890670.00 12275000.00 2682.17
22 KS Flood 24.00 23.00 547780350.00 108071000.00 655.85
23 KY Tornado 125.00 2806.00 888768680.00 1908000.00 890.68
24 KY Flood 59.00 27.00 790311000.00 39120500.00 829.43
25 LA Tornado 156.00 2676.00 1229367890.00 3843000.00 1233.21
26 LA Wind 34.00 288.00 851129050.00 1712000.00 852.84
27 MA Tornado 108.00 1758.00 756039145.00 0.00 756.04
28 MA Wind 16.00 151.00 57680690.00 1262000.00 58.94
29 MD Flood 13.00 29.00 148993000.00 1385000.00 150.38
30 MI Tornado 243.00 3362.00 1071765550.00 1513000.00 1073.28
31 MI Wind 55.00 384.00 434489650.00 49613000.00 484.10
32 MN Tornado 99.00 1976.00 1903701140.00 13196050.00 1916.90
33 MN Flood 18.00 40.00 1557228400.00 115991500.00 1673.22
34 MO Tornado 388.00 4330.00 4800701725.00 22266000.00 4822.97
35 MO Flood 88.00 40.00 848635730.00 664863300.00 1513.50
36 MS Hurricane 16.00 105.00 14178100010.00 1514980800.00 15693.08
37 MS Tornado 450.00 6246.00 2442464530.00 54135000.00 2496.60
38 MT Wind 12.00 51.00 42984100.00 15431000.00 58.42
39 NC Hurricane 32.00 25.00 5569621000.00 500956730000.00 506526.35
40 NC Tornado 126.00 2548.00 1551933680.00 4437000.00 1556.37
41 ND Tornado 25.00 326.00 172766270.00 11735000.00 184.50
42 NE Tornado 54.00 1158.00 1718164710.00 27545750.00 1745.71
43 NE WINTER STORM 11.00 22.00 52094000.00 4720000.00 56.81
44 NJ Flood 25.00 197.00 2850860000.00 750000.00 2851.61
45 NJ Wind 31.00 301.00 93692800.00 1200000.00 94.89
46 NM Flood 18.00 18.00 81007500.00 5381000.00 86.39
47 NV Wind 12.00 61.00 72060600.00 120050.00 72.18
48 NY Flood 58.00 18.00 3157497990.00 6675000.00 3164.17
49 NY Wind 70.00 469.00 633205470.00 12394000.00 645.60
50 OH Tornado 191.00 4442.00 2283157790.00 5383500.00 2288.54
51 OH Flood 54.00 33.00 1717479305.00 132108000.00 1849.59
52 OK Tornado 296.00 4829.00 3268708233.00 50556550.00 3319.26
53 OK Wind 11.00 329.00 1020753990.00 125000.00 1020.88
54 OR Flood 16.00 13.00 723562500.00 18860000.00 742.42
55 OR Wind 21.00 68.00 116853150.00 6110000.00 122.96
56 PA Flood 86.00 164.00 2522659509.00 4505000.00 2527.16
57 PA Tornado 82.00 1241.00 1789088400.00 7129000.00 1796.22
58 PR Hurricane 19.00 1.00 1824431000.00 301150000000.00 1824.43
59 PR Flood 42.00 4.00 313444650.00 60570000.00 374.01
60 SC Tornado 59.00 1314.00 531745190.00 5266050.00 537.01
61 SC Wind 29.00 265.00 173193950.00 17324000.00 190.52
62 SD Tornado 18.00 452.00 231213780.00 640100.00 231.85
63 SD Wind 11.00 165.00 91136950.00 22487100.00 113.62
64 TN Flood 58.00 45.00 4764747170.00 1005867000.00 5770.61
65 TN Tornado 368.00 4748.00 1541799890.00 2679000.00 1544.48
66 TX Tropical Storm 26.00 3.00 5491598000.00 4190000.00 5495.79
67 TX STORM SURGE/TIDE 11.00 0.00 4500385000.00 0.00 4500.39
68 UT Flood 12.00 33.00 371183500.00 937200.00 372.12
69 UT Snow 11.00 259.00 54460750.00 72100.00 54.53
70 VA Flood 47.00 16.00 401930947.00 92610550.00 494.54
71 VA Tornado 36.00 914.00 439239250.00 2156000.00 441.40
72 WA Wind 50.00 106.00 164900700.00 37695000.00 202.60
73 WI Tornado 96.00 1601.00 958093080.00 16513700.00 974.61
74 WI Wind 27.00 266.00 274111050.00 44899750.00 319.01
75 WV Flood 42.00 12.00 786398100.00 2400000.00 788.80