Day 10: North America

Code
suppressPackageStartupMessages({
  library(tidyverse)
  library(sf)
})

na_river <- st_read("./static/data/north-america-lakes-rivers/hydrography_l_rivers_v2.shp", quiet = TRUE)
na_lake <- st_read("./static/data/north-america-lakes-rivers/hydrography_p_lakes_v2.shp", quiet = TRUE)

c(na_river$TYPE, na_lake$TYPE) |>
  sort() |>
  unique() -> wtypes

ggplot() +
  geom_sf(
    data = na_river |> dplyr::filter((TYPE %in% c(12, 16, 17, 18))),
    aes(
      color = factor(TYPE, wtypes),
      linewidth = TYPE
    ),
    show.legend = FALSE
  ) +
  geom_sf(
    data = na_lake |> dplyr::filter((TYPE %in% c(16, 18))),
    aes(fill = factor(TYPE, wtypes)),
    color = NA,
    show.legend = FALSE
  ) +
  scale_linewidth(
    range = c(0.075, 0.125)
  ) +
  annotate(
    "text",
    x = -Inf,
    y = -Inf,
    hjust = 0,
    color = "#7aacd2",
    size = 7,
    lineheight = 0.8,
    family = "Thasadith",
    fontface = "bold",
    label = "North\nAmerica\nRivers & Lakes\n\n\n"
  ) +
  scale_color_brewer("blues") +
  scale_fill_brewer("blues") +
  coord_sf(
    datum = NA
  ) +
  labs(
    caption = "Data source: <www.cec.org>\n<sciencebase.gov/catalog/item/4fb55df0e4b04cb937751e02>"
  ) +
  theme_minimal() +
  theme(
    plot.margin = margin(10, 10, 10, 10),
    plot.background = element_rect(fill = "black"),
    panel.background = element_rect(fill = "black"),
    plot.caption = element_text(
      color = "#c3c3c3",
      family = "Thasadith",
      size = 4
    )
  )