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-11-29 13:00:00, 2022-11-29 14:00:00, 2022-11-29 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> 15.4, 14.5, 15.5, 14.6, 12.2, 10.4, 10.0, 9.6, 10.7, 10.1, 8…
#> $ vv        <dbl> 9.3, 9.7, 8.6, 8.9, 7.3, 4.6, 6.8, 6.0, 6.8, 5.7, 5.8, 5.1, …
#> $ dv        <dbl> 317, 320, 316, 318, 323, 286, 278, 294, 284, 290, 292, 303, …
#> $ lat       <dbl> 41.66056, 41.66056, 41.66056, 41.66056, 41.66056, 41.66056, …
#> $ dmax      <dbl> 318, 313, 315, 310, 328, 338, 275, 285, 288, 303, 243, 308, …
#> $ ubi       <chr> "ZARAGOZA  AEROPUERTO", "ZARAGOZA  AEROPUERTO", "ZARAGOZA  A…
#> $ pres      <dbl> 989.7, 988.9, 989.0, 988.7, 988.9, 989.3, 989.3, 989.4, 989.…
#> $ hr        <dbl> 54, 54, 57, 61, 65, 71, 72, 74, 74, 76, 76, 76, 78, 81, 81, …
#> $ stdvv     <dbl> 1.6, 1.5, 1.4, 1.2, 1.6, 0.6, 1.0, 0.7, 0.8, 0.6, 0.4, 0.6, …
#> $ ts        <dbl> 15.6, 15.4, 14.6, 12.9, 11.8, 10.4, 10.3, 10.0, 9.7, 9.4, 9.…
#> $ pres_nmar <dbl> 1019.7, 1018.8, 1019.0, 1018.8, 1019.1, 1019.6, 1019.7, 1019…
#> $ tamin     <dbl> 14.0, 14.5, 13.9, 13.0, 12.3, 11.1, 10.5, 10.5, 10.1, 9.9, 9…
#> $ ta        <dbl> 14.6, 14.6, 13.9, 13.0, 12.3, 11.1, 10.9, 10.5, 10.3, 9.9, 1…
#> $ tamax     <dbl> 14.6, 14.8, 14.6, 13.9, 13.0, 12.3, 11.1, 10.9, 10.6, 10.7, …
#> $ tpr       <dbl> 5.5, 5.5, 5.5, 5.6, 5.9, 6.1, 6.1, 6.1, 5.9, 5.9, 5.9, 5.9, …
#> $ stddv     <dbl> 9, 8, 8, 8, 10, 10, 8, 7, 6, 6, 5, 7, 8, 7, 9, 10, 10, 9, 10…
#> $ inso      <dbl> 58.7, 58.2, 57.4, 54.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0…
#> $ tss5cm    <dbl> 11.0, 11.4, 11.4, 11.2, 10.8, 10.4, 10.0, 9.8, 9.6, 9.4, 9.3…
#> $ pacutp    <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ tss20cm   <dbl> 9.6, 9.9, 10.2, 10.4, 10.6, 10.7, 10.8, 10.7, 10.7, 10.6, 10…
#> $ rviento   <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …