Skip to contents

Get last observation values for a station.

Usage

aemet_last_obs(station = "all", verbose = FALSE, return_sf = FALSE)

Arguments

station

Character string with station identifier code(s) (see aemet_stations()) or "all" for all the stations.

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.

API Key

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

Examples


library(tibble)
obs <- aemet_last_obs(c("9434", "3195"))
glimpse(obs)
#> Rows: 48
#> Columns: 26
#> $ idema     <chr> "9434", "9434", "9434", "9434", "9434", "9434", "9434", "943…
#> $ lon       <dbl> -1.004167, -1.004167, -1.004167, -1.004167, -1.004167, -1.00…
#> $ fint      <dttm> 2022-08-16 13:00:00, 2022-08-16 14:00:00, 2022-08-16 15:00:…
#> $ prec      <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ alt       <dbl> 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, …
#> $ vmax      <dbl> 4.2, 4.9, 8.9, 7.2, 12.3, 10.5, 10.9, 7.2, 9.0, 12.0, 12.9, …
#> $ vv        <dbl> 1.6, 1.5, 4.1, 4.4, 7.2, 7.2, 5.4, 5.2, 6.9, 9.2, 9.3, 6.7, …
#> $ dv        <dbl> 18, 42, 276, 262, 263, 271, 166, 314, 308, 302, 297, 296, 29…
#> $ lat       <dbl> 41.66056, 41.66056, 41.66056, 41.66056, 41.66056, 41.66056, …
#> $ dmax      <dbl> 350, 45, 273, 285, 250, 265, 150, 323, 310, 315, 295, 300, 3…
#> $ ubi       <chr> "ZARAGOZA  AEROPUERTO", "ZARAGOZA  AEROPUERTO", "ZARAGOZA  A…
#> $ pres      <dbl> 977.4, 976.3, 975.5, 974.9, 975.0, 975.4, 976.7, 977.8, 978.…
#> $ hr        <dbl> 20, 18, 15, 11, 11, 12, 31, 26, 34, 52, 56, 61, 60, 59, 64, …
#> $ stdvv     <dbl> 0.6, 0.8, 1.3, 1.0, 1.4, 1.2, 1.3, 0.7, 0.8, 1.2, 0.9, 0.7, …
#> $ ts        <dbl> 38.6, 39.3, 39.9, 39.7, 37.9, 36.0, 30.4, 30.1, 27.9, 25.1, …
#> $ pres_nmar <dbl> 1005.2, 1003.9, 1003.0, 1002.3, 1002.5, 1003.0, 1004.6, 1005…
#> $ tamin     <dbl> 30.9, 32.3, 34.0, 34.6, 35.4, 34.7, 30.3, 29.7, 27.5, 24.3, …
#> $ ta        <dbl> 32.4, 34.1, 34.9, 36.0, 35.4, 34.7, 30.3, 29.7, 27.5, 24.3, …
#> $ tamax     <dbl> 32.4, 34.1, 35.3, 36.1, 36.3, 35.5, 34.7, 30.3, 29.8, 27.5, …
#> $ tpr       <dbl> 6.5, 6.4, 4.5, 0.9, 0.4, 1.1, 11.3, 8.1, 10.3, 13.9, 13.3, 1…
#> $ stddv     <dbl> 42, 73, 19, 26, 12, 10, 35, 9, 5, 6, 6, 6, 6, 6, 9, 7, 6, 9,…
#> $ inso      <dbl> 49.5, 60.0, 58.7, 43.5, 51.0, 48.8, 17.0, 0.0, 0.0, 0.0, 0.0…
#> $ tss5cm    <dbl> 38.0, 39.7, 41.0, 40.9, 40.5, 39.6, 38.5, 37.3, 36.1, 35.1, …
#> $ pacutp    <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ tss20cm   <dbl> 33.1, 33.4, 33.7, 34.2, 34.6, 35.0, 35.3, 35.5, 35.6, 35.6, …
#> $ rviento   <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …