The Most Alarming Weather Events

Kuba
December 3, 2020

Shiny Application and Reproducible Pitch

NOAA Storm data, 1950-2011

Subject

The U.S. National Oceanic and Atmospheric Administration (NOAA) collects data on most massive storms and weather events in the US:

  • when and where they occur,
  • estimates of any harm to humans, and damage to economics

The aim is to find out which types of severe weather events are most harmful to population health and have the most significant economic consequences

It can be used for proper government preparation to such events so that to prioritise resources and prevent destructive outcomes to the extent possible

More information can be found at NOAA Storm Events FAQ

Elements

  • Shiny Application StormApp deployed on Rstudio's shiny server
    • documentation for users
    • widget input panel of lists for Harm to Humans (total harm, deaths/ injuries dangers) and Damage to Economics (total damage, dangers to property/ crops)
    • reactive output of plots/ tables of Top Dangers to Humans and Economics
      • plots show Top-10 Dangers for chosen category
      • tables displays top-list of Dangers according to selected length (10, 20, 48 - the total number of events types)
    • shared server.R and ui.R code on github
  • Current Presentation
    • done with Rstudio Presenter (code) and hosted on Rpubs
    • R expression evaluated/ displayed, and server calculation displayed

Data Summary

  • Cleaning and processing of raw data have been carried out during Reproducible Research Storm Project
library(data.table)
storm <- fread("./data/storm.csv"); storm[,3:8]
          BGN_DATE     EVTYPE DEATHS INJURIES PROP ($, mln) CROP ($, mln)
     1: 1950-04-18    TORNADO      0       15          0.32             0
     2: 1950-04-18    TORNADO      0        0          0.00             0
     3: 1950-01-13    TORNADO      1        1          0.00             0
     4: 1950-02-12    TORNADO      0        0          0.00             0
     5: 1950-02-12    TORNADO      0        0          0.32             0
    ---                                                                  
702218: 2011-11-30  HIGH WIND      0        0          0.00             0
702219: 2011-11-10  HIGH WIND      0        0          0.00             0
702220: 2011-11-08  HIGH WIND      0        0          0.00             0
702221: 2011-11-09   BLIZZARD      0        0          0.00             0
702222: 2011-11-28 HEAVY SNOW      0        0          0.00             0
  • Weights of each severe event type in total harm and damage have been derived from calculated danger ratio for single event
danger <- fread("./data/danger.csv"); head(danger)
                  EVTYPE DEATHS, % INJURIES, % PROP, % CROP, %
1: ASTRONOMICAL LOW TIDE      0.00        0.00    0.00    0.00
2:             AVALANCHE      0.24        0.18    0.00    0.00
3:              BLIZZARD      0.12        0.92    0.26    0.05
4:         COASTAL FLOOD      0.01        0.01    0.13    0.00
5:       COLD/WIND CHILL      0.17        0.07    0.02    0.03
6:           DEBRIS FLOW      0.05        0.06    0.09    0.00

Server Calculations

  • Calculations performed by server.R when Total Harm to Humans plot is selected
library(dplyr); library(ggplot2)
topHARM <- danger %>% transmute(
  EVTYPE,`TOTAL_HARM, %`=`DEATHS, %`+`INJURIES, %`,
  `DEATHS, %`,`INJURIES, %`) %>%
  arrange(desc(`TOTAL_HARM, %`))
topH <- topHARM %>% head(n = 10)
topH <- melt(
  select(topH, EVTYPE, `DEATHS, %`, `INJURIES, %`))
topH$EVTYPE <- reorder(topH$EVTYPE, topH$value)
gtopH<- topH %>%
  ggplot(aes(x = EVTYPE, y = value,
             fill = variable, order = variable)) +
  geom_bar(stat="identity") + coord_flip() +
  scale_fill_manual(
    name="",values =c("firebrick3","springgreen3"))+
  xlab("Event Type")+ ylab("Total Harm, %")+
  labs(title ="Top-10 DANGERS to HUMANS, %")+
  theme(plot.title = element_text(size = rel(0.9)),
        axis.line =
          element_line(size = 3, colour = "grey80"))

plot of chunk plot