Data source: NOAA csv, Data dictionary: NOAA pdf

Column

Tornado Frequency

Tornado Distribution

Tornado Trend

Column

Descriptive

Climate change could result in severe natural disasters such as tornado. National Oceanic and Atmospheric Administration (NOAA) keeps recording tornado statistics since 1950. Such statistics include specific time, (E)F-scale, injuries, fatalities, estimated property loss, estimated crop loss, specific coordinates, and so forth.

 

Figure 1 shows the tornado frequency count by State from January 3rd, 1950 to August 28, 2018. Dataset contains all the 50 States plus Washington District of Columbia (DC) and Puerto Rico (PR). Not a single U.S. territory has not experienced tornado in the past 70 years. Texas (TX) suffered most.

 

Figure 2 shows the stacked bar plot of the tornado intensity by decade. Tornado intensity is often defined by the Fujita scale (F-scale): 1) F0, 40–72mph, light damage; F1, 73–112mph, moderate damage; F2, 113–157mph, considerable damage; F3, 158–206mph, severe damage; F4, 207–260mph, devastating damage; F5, 261–318mph, incredible damage. However, “-9” indicates missing values. Also, dataset switched to EF-scale after January 2007.

 

Figure 3 shows the line plot of the tornado frequency count by year in black line while red line represents 5-year moving average.

Analysis

  1. Tornado often occurs in the Southern territories in the U.S.
  2. F0 scale tornadoes increased from 1990 to 2009. F1 scale tornadoes relatively remained in the same occurrence in the past 5 decades. The higher scale tornadoes, however, occurred less since 1980.
  3. The overall trend suggests that tornado occurrence increased from 1950 to 1982, decreased from 1983 to 1987, then rocketed to the peak in 2004, and fluctuated to date.
---
title: "ANLY-512: Data Exploration and Analysis Laboratory"
author: "Zhengxiao Wei"
date: "2019-02-09"
output: 
  flexdashboard::flex_dashboard:
    source_code: embed
    navbar:
      - { title: "About", href: "https://moodle.harrisburgu.edu/pluginfile.php/579544/mod_assign/introattachment/0/Lab2%20Data%20Exploration%20and%20Analysis.html?forcedownload=1", align: right }
---

```{r setup, include=F}
if(!require(dplyr)) {install.packages("dplyr")}
if(!require(ggplot2)) {install.packages("ggplot2")}
if(!require(plotly)) {install.packages("plotly")}
if(!require(scales)) {install.packages("scales")}
if(!require(usmap)) {install.packages("usmap")}
if(!require(zoo)) {install.packages("zoo")}

library(ggplot2)
library(usmap)
```

```{r setup-data, cache=F, include=F}
tornado <- read.csv(url("https://www.spc.noaa.gov/wcm/data/1950-2017_actual_tornadoes.csv"))
```

Data source: [NOAA csv](https://www.spc.noaa.gov/wcm/#data), Data dictionary: [NOAA pdf](https://www.spc.noaa.gov/wcm/data/SPC_severe_database_description.pdf)

Column {.tabset data-width=750}
-----------------------------------------------------------------------

### Tornado Frequency

```{r map}
#create a table of frequency count by State
freq <- as.data.frame(table(tornado$st))
colnames(freq) <- c("state","count")

plot_usmap(data=freq,values="count",color="red")+scale_fill_continuous(low="white",high="red",name="Count")+ggtitle("Tornado Frequency by State: 1950-2018")+theme(legend.position="right",plot.title=element_text(hjust=0.5,size=15,face="bold"))
```

### Tornado Distribution

```{r stacked barplot}
#create a two-dimensional table of frequency count by year and intensity
sta <- as.data.frame(table(tornado$yr,tornado$mag),stringsAsFactors=F)
sta$Var1 <- as.integer(sta$Var1)
sta$Decade <- dplyr::case_when(sta$Var1>=1950&sta$Var1<=1959~"1950-1959",sta$Var1>=1960&sta$Var1<=1969~"1960-1969",sta$Var1>=1970&sta$Var1<=1979~"1970-1979",sta$Var1>=1980&sta$Var1<=1989~"1980-1989",sta$Var1>=1990&sta$Var1<=1999~"1990-1999",sta$Var1>=2000&sta$Var1<=2009~"2000-2009",TRUE~"2010-")

p2 <- ggplot(sta,aes(Var2,Freq,fill=Decade))+geom_bar(stat="identity")+scale_fill_brewer(palette="Blues")+labs(x="(E)F-scale",y="Frequency Count")+ggtitle("Tornado Intensity")
plotly::ggplotly(p2)
```

### Tornado Trend

```{r line plot}
#create a table of frequency count by year
trend <- as.data.frame(table(tornado$yr))
trend$Var1 <- as.Date(trend$Var1,format="%Y")
#5-year moving average (ma)
trend$ma <- zoo::rollmean(trend$Freq,5,fill=NA)

p3 <- ggplot(trend,aes(Var1,Freq))+geom_line()+labs(x="Date",y="Frequency Count")+ggtitle("Tornado Trend: 1950-2018")+geom_line(aes(Var1,ma),color="red")
plotly::ggplotly(p3)
```

Column
-----------------------------------------------------------------------
### Descriptive {data-height=800}
Climate change could result in severe natural disasters such as **tornado**. National Oceanic and Atmospheric Administration (NOAA) keeps recording tornado statistics since 1950. Such statistics include specific time, (E)F-scale, injuries, fatalities, estimated property loss, estimated crop loss, specific coordinates, and so forth.
  
 

Figure 1 shows the tornado frequency count by State from January 3rd, 1950 to August 28, 2018. Dataset contains all the 50 States plus Washington District of Columbia (DC) and Puerto Rico (PR). Not a single U.S. territory has not experienced tornado in the past 70 years. Texas (TX) suffered most.
  
 

Figure 2 shows the stacked bar plot of the tornado intensity by decade. Tornado intensity is often defined by the Fujita scale (F-scale): 1) F0, 40–72mph, light damage; F1, 73–112mph, moderate damage; F2, 113–157mph, considerable damage; F3, 158–206mph, severe damage; F4, 207–260mph, devastating damage; F5, 261–318mph, incredible damage. However, "-9" indicates missing values. Also, dataset switched to EF-scale after January 2007.

 

Figure 3 shows the line plot of the tornado frequency count by year in black line while red line represents 5-year moving average.

### Analysis
1. Tornado often occurs in the Southern territories in the U.S.
2. F0 scale tornadoes increased from 1990 to 2009. F1 scale tornadoes relatively remained in the same occurrence in the past 5 decades. The higher scale tornadoes, however, occurred less since 1980.
3. The overall trend suggests that tornado occurrence increased from 1950 to 1982, decreased from 1983 to 1987, then rocketed to the peak in 2004, and fluctuated to date.