aemet_forecast_beaches {climaemet}R Documentation

Forecast database for beaches

Description

Get a database of daily weather forecasts for a beach. Beach database can be accessed with aemet_beaches().

Usage

aemet_forecast_beaches(
  x,
  verbose = FALSE,
  return_sf = FALSE,
  extract_metadata = FALSE,
  progress = TRUE
)

Arguments

x

A vector of beaches codes to extract. See aemet_beaches().

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.

extract_metadata

Logical TRUE/FALSE. On TRUE the output is a tibble with the description of the fields. See also get_metadata_aemet().

progress

Logical, display a cli::cli_progress_bar() object. If verbose = TRUE won't be displayed.

Value

A tibble or a sf object.

API Key

You need to set your API Key globally using aemet_api_key().

See Also

aemet_beaches() for beaches codes.

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

Other forecasts: aemet_forecast_daily(), aemet_forecast_tidy()

Examples


# Forecast for beaches in Palma, Mallorca
library(dplyr)
library(ggplot2)

palma_b <- aemet_beaches() %>%
  filter(ID_MUNICIPIO == "07040")

forecast_b <- aemet_forecast_beaches(palma_b$ID_PLAYA)
glimpse(forecast_b)

ggplot(forecast_b) +
  geom_line(aes(fecha, tagua_valor1, color = nombre)) +
  facet_wrap(~nombre, ncol = 1) +
  labs(
    title = "Water temperature in beaches of Palma (ES)",
    subtitle = "Forecast 3-days",
    x = "Date",
    y = "Temperature (Celsius)",
    color = "Beach"
  )


[Package climaemet version 1.3.0 Index]