library(glue)
library(dplyr)
library(sf)
library(janitor)
library(readxl)
library(leaflet)
library(leaflet.providers)
library(leaflet.extras)Day 28 of 30DayMapChallenge: « Black » (previously).
There is a global oil spill dataset from 1967 to 2023 by Liu, Yin, and Cai (2025).
Config
Data
# https://figshare.com/ndownloader/files/55233773
if (!file.exists("enhanced_global_oil_spill_data_240711.xlsx")) {
download.file("https://figshare.com/ndownloader/files/55233773",
"enhanced_global_oil_spill_data_240711.xlsx")
}
oil <- read_xlsx("enhanced_global_oil_spill_data_240711.xlsx",
sheet = "Oil spill incidents",
.name_repair = make_clean_names) |>
mutate(release_m3 = if_else(max_ptl_release_gallons == -1,
NA_real_,
round(0.00454609 * max_ptl_release_gallons))) |>
st_as_sf(coords = c("lon", "lat"), crs = "EPSG:4326")Map
oil |>
leaflet() |>
addTiles(attribution = r"(
<a href="https://r.iresmi.net/">r.iresmi.net</a>.
data <a href="https://doi.org/10.1038/s41597-025-05601-9">Liu <i>et al.</i></a>
)") |>
addProviderTiles("Stadia.AlidadeSmoothDark") |>
addCircleMarkers(
radius = ~ release_m3 / 1e3,
color = "grey",
popup = ~ glue("<b>{name}</b> {open_date}<br />
<i>{commodity}</i> - {release_m3} m³<br />
{description}"),
clusterOptions = markerClusterOptions()) |>
addFullscreenControl()References
Liu, Yiming, Zhuoli Yin, and Hua Cai. 2025. “Enhanced Global Oil Spill Dataset from 1967 to 2023 Based on Text-Form Incident Information.” Scientific Data 12 (1): 1394. https://doi.org/10.1038/s41597-025-05601-9.
