Base Code
library(tidyverse)
library(patchwork)
library(ggthemes)
library(viridis)
library(ggplot2)
library(patchwork)
library(plotly)
library(DT)
q <- 0
The Data Source
tornado_data_1950_to_2024_may <- read_csv("tornado_data_1950_to_2024_may_updated.csv")
### DATA RECEIVED FROM THE STORM PREDICTION CENTER OF THE NATIONAL OCEANIC
### AND ATMOSPHERIC ADMINISTRATION
datatable(tornado_data_1950_to_2024_may)
The New Graphs:
plot1 <- ggplot(tornado_data_1950_to_2024_may, aes(x = Year)) +
geom_line(aes(y = Tornadoes, color = "Tornadoes"), size = 0.5) +
geom_point(aes(y = Tornadoes, color = "Tornadoes", text = paste0("Year: ", Year,
"<br>Tornadoes: ", Tornadoes,
"<br>Max Rating: ", `Max Rating`)))+
geom_col(aes(y = Fatalities, fill = "Fatalities", text = paste0("Year: ", Year,
"<br>Fatalities: ", Fatalities,
"<br>Notable Event(s): ", `Notable Event(s)`))) +
labs(title = "USA Number of Tornadoes and Tornadic Fatalities in May (1950-2024)", x = "Year", y = "Count") +
theme_minimal() +
scale_fill_manual(name = "Bar Legend", values = c("Fatalities" = "firebrick")) +
scale_color_manual(name = "Line Legend", values = c("Tornadoes" = "steelblue"))
plot2 <- ggplot(tornado_data_1950_to_2024_may, aes(x = Year, y = Tornadoes)) +
geom_line(aes(x = Year, y = Tornadoes, color = "Tornadoes"), size = 0.5) +
geom_point(aes(x = Year, y = Tornadoes, color = "Tornadoes", text = paste0("Year: ", Year,
"<br>Tornadoes: ", Tornadoes,
"<br>Max Rating: ", `Max Rating`))) +
labs(title = "US Tornadoes in May (1950-2024)", x = "Year", y = "Number of Tornadoes") +
theme_minimal() +
scale_color_manual(name = "Legend", values = c("Tornadoes" = "steelblue")) +
geom_smooth(method = lm, se = FALSE, color = "black", linetype = "dashed", size = 0.8)
plot3 <- ggplot(tornado_data_1950_to_2024_may, aes(x = Year, y = Fatalities)) +
geom_line(aes(y = Fatalities, color = "Fatalities"), size = 0.5) +
geom_point(aes(y = Fatalities, color = "Fatalities",
text = paste0("Year: ", Year,
"<br>Fatalities: ", Fatalities,
"<br>Notable Event(s): ", `Notable Event(s)`))) +
labs(title = "US Tornadic Fatalities in May (1950-2024)",
x = "Year", y = "Number of Fatalities") +
theme_minimal() +
scale_color_manual(name = "Legend", values = c("Fatalities" = "firebrick")) +
geom_smooth(method = lm, se = FALSE, color = "black", linetype = "dashed", size = 0.8)
ggplotly(plot1, tooltip = "text")
ggplotly(plot2, tooltip = "text")
ggplotly(plot3, tooltip = "text")