## climaemet <img src="https://ropenspain.github.io/climaemet/logo.png" alt="catastro-logo" height="70" style="margin-top: -10px;vertical-align: middle;"> <span style="font-size: 50%;">(on CRAN)</span> **Key features**: - Retrieves climatic information registered by the AEMET stations (wind speed, temperature, air pressure. - Can retrieve data on **spatial format** (*sf**). **Data sources**: - [Agencia Estatal de Meteorología](https://opendata.aemet.es/centrodedescargas/inicio). **Output formats:** - Formatted **tibble** for compatibility with **tidyverse**. Dates and numbers are formatted properly - Geo-tagged points (**sf**) using the option `return_sf = TRUE`. **(Free) API key required** Needs an API Key ([Go get it](https://opendata.aemet.es/centrodedescargas/obtencionAPIKey)). Can be recorded as environment variable on R using `aemet_api_key(<apikey>, install = TRUE)` --- ## Quick demo .pull-left[ ```r library(climaemet) library(tidyverse) temp2020 <- aemet_daily_period( "8416", start = 2020, end = 2020 ) ggplot(temp2020) + geom_col(aes(fecha, tmed, fill = tmed)) + scale_fill_gradientn( colours = hcl.colors(20, "RdBu", rev = TRUE), labels = scales::label_number(suffix = "º") ) + guides(fill = guide_colorsteps()) + theme_minimal() + labs( title = "Valencia, Spain", subtitle = "AEMET Station Id: 8416", fill = "Avg. daily temp." ) + ylab("Celsius degrees") + xlab("date") ``` ] .pull-right[ <img src="data:image/png;base64,#index_files/figure-html/unnamed-chunk-1-1.png" width="100%" /> ]