Skip to contents

Get AEMET stations.

Usage

aemet_stations(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.

Value

A tibble or a sf object

Note

Code modified from project https://github.com/SevillaR/aemet

API Key

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

Examples

library(tibble)
stations <- aemet_stations()
stations
#> # A tibble: 291 × 7
#>    indicativo indsinop nombre                 provincia altitud longitud latitud
#>    <chr>      <chr>    <chr>                  <chr>       <dbl>    <dbl>   <dbl>
#>  1 0252D      "08186"  ARENYS DE MAR          BARCELONA      74     2.54    41.6
#>  2 0076       "08181"  BARCELONA AEROPUERTO   BARCELONA       4     2.07    41.3
#>  3 0200E      ""       BARCELONA, FABRA       BARCELONA     408     2.12    41.4
#>  4 0201D      "08180"  BARCELONA              BARCELONA       6     2.2     41.4
#>  5 0149X      "08174"  MANRESA                BARCELONA     291     1.84    41.7
#>  6 0229I      "08192"  SABADELL AEROPUERTO    BARCELONA     146     2.10    41.5
#>  7 0255B      "08188"  SANTA SUSANNA          BARCELONA      40     2.70    41.7
#>  8 0367       "08184"  GIRONA AEROPUERTO      GIRONA        143     2.76    41.9
#>  9 0370B      ""       GIRONA, ANTIC INSTITUT GIRONA         95     2.83    42.0
#> 10 0372C      "08120"  PORQUERES              GIRONA        157     2.76    42.1
#> # ℹ 281 more rows