aemet_beaches {climaemet}R Documentation

AEMET beaches

Description

Get AEMET beaches.

Usage

aemet_beaches(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 the API call on each session is (temporarily) cached in the assigned tempdir() for avoiding unneeded API calls.

Value

A tibble or a sf object.

API Key

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

See Also

aemet_forecast_beaches()

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

Examples


library(tibble)
beaches <- aemet_beaches()
beaches

# Cached during this R session
beaches2 <- aemet_beaches(verbose = TRUE)

identical(beaches, beaches2)

# Select an map beaches
library(dplyr)
library(ggplot2)
library(mapSpain)

# Alicante / Alacant
beaches_sf <- aemet_beaches(return_sf = TRUE) %>%
  filter(ID_PROVINCIA == "03")

prov <- mapSpain::esp_get_prov("Alicante")

ggplot(prov) +
  geom_sf() +
  geom_sf(
    data = beaches_sf, shape = 4, size = 2.5,
    color = "blue"
  )


[Package climaemet version 1.3.0 Index]