Hurricane Data

with usmap()

Published

October 9, 2024

Hurricane Data

One interesting analysis is

. Hurricane Data Analysis in R

Another, lighter visualization:

. Hurricane Watch from FlowingData.

. 2020 Hurricane Season

New packages

  • We’ll use the sf package.

  • Also, the usmap package.

  • And, the clock package.

# packages to install
library(tidyverse)
# install.packages("usmap")
library(usmap)
# install.packages("clock")
# 
# just install, do not call library on usmap

Updated Storms Data

  • Download new storm data here

  • This was created by following this

Plot trajectories on a map

# load updated storms data
storms <- read_csv("../data/storms.csv") |>
  # the usmap_transform() function requires "lon"
  rename(lon = long) |>
  mutate(category = as_factor(category))

df_s <- storms |> 
  filter(status == "hurricane",
         as.numeric(category) > 2,
         year == 2023)

# project lon/lat coords to match the usmap projection
# be sure to look at names(df_t)
df_t <- usmap_transform(df_s)

# can also do: include = c("CO","MI") below
plot_usmap(include = .south_region) + 
  # geom_sf does a lot for you here, 
  # as it uses the "geometry" variable to determine location on map
  geom_sf(data = df_t) +
  geom_sf_label(data = df_t, aes(label = name))

# date_build uses the "clock" library
storms <- storms |> mutate(
    date = clock::date_build(year, month, day))

storms |> 
  filter(status == "hurricane",
         year == 2023) |> 
ggplot(
       aes(
         x = date,
         y = name,
         color = category)) + 
#  geom_line(size=2) + 
  geom_point(aes(size = category))