View source: R/aemet_alert_zones.R
aemet_alert_zones | R Documentation |
Get AEMET alert zones.
aemet_alert_zones(verbose = FALSE, return_sf = FALSE)
verbose |
Logical |
return_sf |
Logical |
The first result of the call on each session is (temporarily) cached in
the assigned tempdir()
for avoiding unneeded API calls.
A tibble
or a sf object.
https://www.aemet.es/es/eltiempo/prediccion/avisos/ayuda. See also Annex 2 and Annex 3 docs, linked in this page.
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()
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 an 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.