aemet_alert_zones: AEMET alert zones

View source: R/aemet-alert-zones.R

aemet_alert_zonesR Documentation

AEMET alert zones

Description

Get AEMET alert zones.

Usage

aemet_alert_zones(verbose = FALSE, return_sf = FALSE)

Arguments

verbose

Logical TRUE/FALSE. Provides information about the flow of information between the client and server.

return_sf

Logical TRUE or FALSE. Should the function return an sf spatial object? If FALSE (the default value) it returns a tibble. Note that you need to have the sf package installed.

Details

The first result of each call per session is temporarily cached in tempdir() to avoid unnecessary API calls.

Value

A tibble or a sf object.

Source

https://www.aemet.es/es/eltiempo/prediccion/avisos/ayuda. See also Annex 2 and Annex 3 docs, linked in that page.

See Also

aemet_alerts()

Other aemet_api_data: aemet_alerts(), aemet_beaches(), aemet_daily_clim(), aemet_extremes_clim(), aemet_forecast_beaches(), aemet_forecast_daily(), aemet_forecast_fires(), aemet_last_obs(), aemet_monthly, aemet_normal, aemet_stations()

Examples


library(tibble)
alert_zones <- aemet_alert_zones()
alert_zones

# Cached during this R session
alert_zones2 <- aemet_alert_zones(verbose = TRUE)

identical(alert_zones, alert_zones2)

# Select and map beaches
library(dplyr)
library(ggplot2)

# Galicia
alert_zones_sf <- aemet_alert_zones(return_sf = TRUE) |>
  filter(COD_CCAA == "71")

# Coast zones are identified by a "C" in COD_Z
alert_zones_sf$type <- ifelse(grepl("C$", alert_zones_sf$COD_Z),
  "Coast", "Mainland"
)

ggplot(alert_zones_sf) +
  geom_sf(aes(fill = NOM_PROV)) +
  facet_wrap(~type) +
  scale_fill_brewer(palette = "Blues")


climaemet documentation built on March 24, 2026, 1:06 a.m.