library(formattable)
library(ggmap)
library(ggstream)
library(leaflet)
library(lubridate)
library(readxl)
library(tidyverse)

tidyverse_logo()
## * __  _    __   .    o           *  . 
##  / /_(_)__/ /_ ___  _____ _______ ___ 
## / __/ / _  / // / |/ / -_) __(_-</ -_)
## \__/_/\_,_/\_, /|___/\__/_/ /___/\__/ 
##      *  . /___/      o      .       *

Data Source: NOAA.gov

National Centers for Environmental Information

files <- list.files(path = "D:/Dropbox/Statistics/Data Sets/SED/", pattern = "*.csv")

storm_data <- data.frame()

for (i in seq_along(files)) {

  file <- read_csv(paste0("D:/Dropbox/Statistics/Data Sets/SED/", files[i]))

  storm_data <- rbind(storm_data, file)
}

storm_data <- storm_data %>%
  janitor::clean_names() %>%
  select(-flood_cause, -tor_width, -tor_length, -tor_f_scale, -tor_other_cz_fips, -category,
         -tor_other_cz_name, -tor_other_cz_state, -tor_other_wfo, -data_source) %>%
  mutate(timezone = gsub("-.*$", "", cz_timezone), .keep = 'unused') %>%
  mutate(begin_date_time = dmy_hms(begin_date_time),
         end_date_time = dmy_hms(end_date_time)) %>%
  select(-begin_yearmonth, -end_yearmonth, -begin_day, -end_day, -month_name, 
         -begin_time, -end_time) %>%
  arrange(begin_date_time)

texas <- storm_data %>% filter(state == "TEXAS")
## [1] "Whole Data Set: 358.7MB"
## [1] "Texas Data Set: 26.4MB"

Texas Data

glimpse(texas)
## Rows: 51,741
## Columns: 34
## $ episode_id        <dbl> 36834, 36834, 36834, 36834, 36834, 36834, 36834, 368~
## $ event_id          <dbl> 214137, 214139, 214136, 214145, 214141, 214144, 2141~
## $ state             <chr> "TEXAS", "TEXAS", "TEXAS", "TEXAS", "TEXAS", "TEXAS"~
## $ state_fips        <dbl> 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, ~
## $ year              <dbl> 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010~
## $ event_type        <chr> "Drought", "Drought", "Drought", "Drought", "Drought~
## $ cz_type           <chr> "Z", "Z", "Z", "Z", "Z", "Z", "Z", "Z", "Z", "Z", "Z~
## $ cz_fips           <dbl> 240, 239, 231, 242, 240, 243, 244, 241, 119, 26, 258~
## $ cz_name           <chr> "DUVAL", "WEBB", "LIVE OAK", "KLEBERG", "DUVAL", "NU~
## $ wfo               <chr> "CRP", "CRP", "CRP", "CRP", "CRP", "CRP", "CRP", "CR~
## $ begin_date_time   <dttm> 2010-01-01 00:00:00, 2010-01-01 00:00:00, 2010-01-0~
## $ end_date_time     <dttm> 2010-01-18 23:59:00, 2010-01-31 23:59:00, 2010-01-1~
## $ injuries_direct   <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0~
## $ injuries_indirect <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 4~
## $ deaths_direct     <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0~
## $ deaths_indirect   <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0~
## $ damage_property   <chr> NA, NA, NA, NA, NA, NA, NA, NA, "40.00K", "50.00K", ~
## $ damage_crops      <chr> NA, NA, NA, NA, NA, NA, NA, NA, "0.00K", "0.00K", "0~
## $ source            <chr> "Official NWS Observations", "Official NWS Observati~
## $ magnitude         <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, 43, 35, NA, NA, ~
## $ magnitude_type    <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, "EG", "MS", NA, ~
## $ begin_range       <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ~
## $ begin_azimuth     <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ~
## $ begin_location    <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ~
## $ end_range         <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ~
## $ end_azimuth       <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ~
## $ end_location      <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ~
## $ begin_lat         <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ~
## $ begin_lon         <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ~
## $ end_lat           <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ~
## $ end_lon           <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ~
## $ episode_narrative <chr> "Overall, drought conditions continued to ease acros~
## $ event_narrative   <chr> "Overall, drought conditions continued to ease acros~
## $ timezone          <chr> "CST", "CST", "CST", "CST", "CST", "CST", "CST", "CS~

Top event types by state

State Event Type Count
TEXAS Hail 14076
KANSAS Hail 11281
TEXAS Thunderstorm Wind 9800
PENNSYLVANIA Thunderstorm Wind 9439
VIRGINIA Thunderstorm Wind 9140
TEXAS Drought 9123

Top event types: Texas

Event Type Count Percent
Hail 14076 27.0%
Thunderstorm Wind 9800 19.0%
Drought 9123 18.0%
Flash Flood 4317 8.0%
High Wind 2468 5.0%
Winter Weather 1861 4.0%
Tornado 1453 3.0%
Heat 1281 2.0%
Flood 907 2.0%
Winter Storm 870 2.0%
Total 46156

Texas: Top events distribution

Event Types: Houston, Texas

Houston Texas: Hail 2010-2021

Dallas Texas: Thunderstorm Wind 2010-2021

Texas: Highest Drought Counties Aggregate: 2010-2021

Houston Texas: Flooding 2010-2021