Skip to contents

Get last observation values for a station.

Usage

aemet_last_obs(
  station = "all",
  verbose = FALSE,
  return_sf = FALSE,
  extract_metadata = 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.

extract_metadata

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

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> 2024-02-20 13:00:00, 2024-02-20 14:00:00, 2024-02-20 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> 14.6, 12.9, 11.7, 11.2, 12.1, 6.9, 5.3, 4.5, 3.9, 5.1, 4.9, …
#> $ vv        <dbl> 8.3, 10.2, 6.6, 7.5, 6.3, 4.6, 2.8, 2.5, 2.8, 4.0, 1.3, 1.4,…
#> $ dv        <dbl> 313, 311, 313, 305, 293, 264, 253, 253, 249, 256, 341, 234, …
#> $ lat       <dbl> 41.66056, 41.66056, 41.66056, 41.66056, 41.66056, 41.66056, …
#> $ dmax      <dbl> 315, 308, 318, 323, 303, 285, 258, 278, 260, 243, 268, 280, …
#> $ ubi       <chr> "ZARAGOZA  AEROPUERTO", "ZARAGOZA  AEROPUERTO", "ZARAGOZA  A…
#> $ pres      <dbl> 997.7, 996.7, 996.8, 996.4, 996.6, 996.8, 996.7, 996.6, 997.…
#> $ hr        <dbl> 35, 31, 28, 26, 31, 36, 35, 33, 41, 43, 47, 48, 51, 56, 61, …
#> $ stdvv     <dbl> 1.2, 1.1, 1.2, 1.1, 0.8, 0.5, 0.5, 0.7, 0.6, 0.4, 0.4, 0.2, …
#> $ ts        <dbl> 19.8, 20.5, 20.9, 19.9, 17.8, 14.8, 13.4, 13.2, 10.8, 10.1, …
#> $ pres_nmar <dbl> 1027.6, 1026.5, 1026.5, 1026.1, 1026.4, 1026.9, 1026.9, 1026…
#> $ tamin     <dbl> 15.6, 17.4, 18.6, 19.1, 18.1, 15.9, 15.1, 15.1, 12.7, 11.4, …
#> $ ta        <dbl> 17.5, 18.6, 19.4, 19.2, 18.1, 15.9, 15.2, 15.1, 12.7, 11.6, …
#> $ tamax     <dbl> 17.5, 18.6, 19.5, 19.4, 19.2, 18.1, 15.9, 16.1, 15.1, 12.7, …
#> $ tpr       <dbl> 1.9, 1.1, 0.4, -0.7, 0.6, 0.9, -0.3, -1.0, -0.3, -0.5, 0.0, …
#> $ stddv     <dbl> 8, 6, 9, 8, 5, 5, 10, 21, 14, 9, 50, 12, 8, 21, 45, 12, 6, 8…
#> $ inso      <dbl> 60.0, 60.0, 60.0, 60.0, 25.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, …
#> $ tss5cm    <dbl> 12.8, 13.7, 14.3, 14.4, 14.2, 13.7, 13.1, 12.6, 12.1, 11.5, …
#> $ pacutp    <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ tss20cm   <dbl> 11.0, 11.2, 11.5, 11.9, 12.2, 12.4, 12.5, 12.6, 12.6, 12.5, …
#> $ rviento   <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …