Skip to content

Commit

Permalink
Prepare for CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Aug 29, 2023
1 parent eb87e94 commit efc9e08
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 90 deletions.
5 changes: 1 addition & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ message: 'To cite package "climaemet" in publications use:'
type: software
license: GPL-3.0-only
title: 'climaemet: Climate AEMET Tools'
version: 1.1.1.9000
version: 1.2.0
doi: 10.5281/zenodo.5205573
abstract: Tools to download the climatic data of the Spanish Meteorological Agency
(AEMET) directly from R using their API and create scientific graphs (climate charts,
Expand Down Expand Up @@ -177,9 +177,6 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0002-4035-0289
year: '2023'
identifiers:
- type: url
value: https://arxiv.org/abs/1403.2805
version: '>= 1.7.0'
- type: software
title: rappdirs
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: climaemet
Title: Climate AEMET Tools
Version: 1.1.1.9000
Version: 1.2.0
Authors@R: c(
person("Manuel", "Pizarro", role = c("aut", "cph"),
comment = c(ORCID = "0000-0002-6981-0154")),
Expand Down
7 changes: 1 addition & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# climaemet (development version)
# climaemet 1.2.0

- Now it is possible to extract metadata from each API call using the
parameter `extract_metadata = TRUE` (#40).
Expand Down Expand Up @@ -81,18 +81,13 @@
# climaemet 0.2.0

- rename `ggstripes_station()` to `climatestripes_station()`.

- `climatogram_normal()`. New function to plot a Walter & Lieth climatic
diagram from normal climatology values.

- `climatogram_period()`. New function to plot a Walter & Lieth climatic
diagram for a specified time period.

- `ggwindrose()`. New function to plot windrose diagram.

- `windrose_days()`. New function to plot a windrose (speed/direction) diagram
of a station over a days period.

- `windrose_period()`. New function to plot a windrose (speed/direction)
diagram of a station over a time period.

Expand Down
4 changes: 2 additions & 2 deletions R/aemet_forecast_hourly.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @family forecasts
#'
#' @param x A vector of municipality codes to extract. For convenience,
#' \pkg{climaemet} provides this data on the dataset [aemet_munic]
#' \CRANpkg{climaemet} provides this data on the dataset [aemet_munic]
#' (see `municipio` field) as of January 2020.
#' @param extract_metadata Logical `TRUE/FALSE`. On `TRUE` the output is
#' a `tibble` with the description of the fields. See also
Expand All @@ -25,7 +25,7 @@
#' @details
#'
#' Forecasts format provided by the AEMET API have a complex structure.
#' Although \pkg{climaemet} returns a `tibble`, each forecasted value is
#' Although \CRANpkg{climaemet} returns a `tibble`, each forecasted value is
#' provided as a nested `tibble`. [aemet_forecast_tidy()] helper function can
#' unnest these values an provide a single unnested `tibble` for the requested
#' variable.
Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,20 @@ library(climaemet)
# See a tibble in action

aemet_last_obs("9434")
#> # A tibble: 23 × 25
#> # A tibble: 24 × 25
#> idema lon fint prec alt vmax vv dv lat dmax
#> <chr> <dbl> <dttm> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 9434 -1.00 2023-08-11 23:00:00 0 249 4.2 1.6 340 41.7 315
#> 2 9434 -1.00 2023-08-12 00:00:00 0 249 5.7 3.5 299 41.7 305
#> 3 9434 -1.00 2023-08-12 01:00:00 0 249 7 5 285 41.7 275
#> 4 9434 -1.00 2023-08-12 02:00:00 0 249 5.3 2.6 326 41.7 285
#> 5 9434 -1.00 2023-08-12 03:00:00 0 249 4.7 0.9 331 41.7 315
#> 6 9434 -1.00 2023-08-12 04:00:00 0 249 3 2.3 239 41.7 240
#> 7 9434 -1.00 2023-08-12 05:00:00 0 249 2.3 1.5 264 41.7 273
#> 8 9434 -1.00 2023-08-12 06:00:00 0 249 3.2 2.1 260 41.7 263
#> 9 9434 -1.00 2023-08-12 07:00:00 0 249 5 4.1 308 41.7 305
#> 10 9434 -1.00 2023-08-12 08:00:00 0 249 5.2 3.7 319 41.7 313
#> # ℹ 13 more rows
#> 1 9434 -1.00 2023-08-28 15:00:00 0 249 19.9 11.8 317 41.7 313
#> 2 9434 -1.00 2023-08-28 16:00:00 0 249 16.4 9.6 317 41.7 320
#> 3 9434 -1.00 2023-08-28 17:00:00 0 249 15.2 8.8 323 41.7 330
#> 4 9434 -1.00 2023-08-28 18:00:00 0 249 13 7.3 323 41.7 330
#> 5 9434 -1.00 2023-08-28 19:00:00 0 249 11.5 5.8 326 41.7 303
#> 6 9434 -1.00 2023-08-28 20:00:00 0 249 10.6 5.8 322 41.7 330
#> 7 9434 -1.00 2023-08-28 21:00:00 0 249 12.8 8 323 41.7 325
#> 8 9434 -1.00 2023-08-28 22:00:00 0 249 11.7 7 325 41.7 335
#> 9 9434 -1.00 2023-08-28 23:00:00 0 249 11 6.7 298 41.7 310
#> 10 9434 -1.00 2023-08-29 00:00:00 0 249 14.2 8.3 290 41.7 303
#> # ℹ 14 more rows
#> # ℹ 15 more variables: ubi <chr>, pres <dbl>, hr <dbl>, stdvv <dbl>, ts <dbl>,
#> # pres_nmar <dbl>, tamin <dbl>, ta <dbl>, tamax <dbl>, tpr <dbl>,
#> # stddv <dbl>, inso <dbl>, tss5cm <dbl>, pacutp <dbl>, tss20cm <dbl>
Expand Down Expand Up @@ -167,14 +167,14 @@ data_observation <- aemet_last_obs(station)
knitr::kable(head(data_observation))
```

| idema | lon | fint | prec | alt | vmax | vv | dv | lat | dmax | ubi | pres | hr | stdvv | ts | pres_nmar | tamin | ta | tamax | tpr | stddv | inso | tss5cm | pacutp | tss20cm |
|:------|----------:|:--------------------|-----:|----:|-----:|----:|----:|---------:|-----:|:--------------------|------:|----:|------:|-----:|----------:|------:|-----:|------:|-----:|------:|-----:|-------:|-------:|--------:|
| 9434 | -1.004167 | 2023-08-11 23:00:00 | 0 | 249 | 4.2 | 1.6 | 340 | 41.66056 | 315 | ZARAGOZA AEROPUERTO | 990.0 | 38 | 0.6 | 27.2 | 1018.5 | 28.2 | 28.2 | 30.0 | 12.5 | 19 | 0 | 34.2 | 0 | 35.7 |
| 9434 | -1.004167 | 2023-08-12 00:00:00 | 0 | 249 | 5.7 | 3.5 | 299 | 41.66056 | 305 | ZARAGOZA AEROPUERTO | 989.8 | 43 | 0.7 | 26.6 | 1018.3 | 27.0 | 27.7 | 28.2 | 13.9 | 12 | 0 | 33.4 | 0 | 35.4 |
| 9434 | -1.004167 | 2023-08-12 01:00:00 | 0 | 249 | 7.0 | 5.0 | 285 | 41.66056 | 275 | ZARAGOZA AEROPUERTO | 989.5 | 49 | 0.4 | 25.9 | 1018.2 | 26.0 | 26.0 | 27.8 | 14.4 | 6 | 0 | 32.8 | 0 | 35.1 |
| 9434 | -1.004167 | 2023-08-12 02:00:00 | 0 | 249 | 5.3 | 2.6 | 326 | 41.66056 | 285 | ZARAGOZA AEROPUERTO | 989.7 | 55 | 0.4 | 24.2 | 1018.6 | 24.4 | 24.4 | 26.0 | 14.8 | 13 | 0 | 32.1 | 0 | 34.8 |
| 9434 | -1.004167 | 2023-08-12 03:00:00 | 0 | 249 | 4.7 | 0.9 | 331 | 41.66056 | 315 | ZARAGOZA AEROPUERTO | 989.6 | 57 | 0.2 | 23.2 | 1018.5 | 24.2 | 24.2 | 24.6 | 15.2 | 30 | 0 | 31.5 | 0 | 34.4 |
| 9434 | -1.004167 | 2023-08-12 04:00:00 | 0 | 249 | 3.0 | 2.3 | 239 | 41.66056 | 240 | ZARAGOZA AEROPUERTO | 989.6 | 51 | 0.4 | 22.7 | 1018.6 | 23.2 | 23.2 | 24.2 | 12.5 | 8 | 0 | 30.8 | 0 | 34.1 |
| idema | lon | fint | prec | alt | vmax | vv | dv | lat | dmax | ubi | pres | hr | stdvv | ts | pres_nmar | tamin | ta | tamax | tpr | stddv | inso | tss5cm | pacutp | tss20cm |
|:------|----------:|:--------------------|-----:|----:|-----:|-----:|----:|---------:|-----:|:--------------------|------:|----:|------:|-----:|----------:|------:|-----:|------:|-----:|------:|-----:|-------:|-------:|--------:|
| 9434 | -1.004167 | 2023-08-28 15:00:00 | 0 | 249 | 19.9 | 11.8 | 317 | 41.66056 | 313 | ZARAGOZA AEROPUERTO | 987.1 | 42 | 1.6 | 31.3 | 1015.9 | 24.1 | 25.0 | 25.3 | 11.2 | 8 | 59.1 | 34.2 | 0 | 30.0 |
| 9434 | -1.004167 | 2023-08-28 16:00:00 | 0 | 249 | 16.4 | 9.6 | 317 | 41.66056 | 320 | ZARAGOZA AEROPUERTO | 986.9 | 40 | 1.7 | 28.7 | 1015.7 | 24.2 | 24.9 | 25.2 | 10.4 | 9 | 20.6 | 33.8 | 0 | 30.4 |
| 9434 | -1.004167 | 2023-08-28 17:00:00 | 0 | 249 | 15.2 | 8.8 | 323 | 41.66056 | 330 | ZARAGOZA AEROPUERTO | 986.8 | 39 | 1.8 | 27.5 | 1015.6 | 24.9 | 24.9 | 26.1 | 10.0 | 10 | 53.9 | 33.7 | 0 | 30.7 |
| 9434 | -1.004167 | 2023-08-28 18:00:00 | 0 | 249 | 13.0 | 7.3 | 323 | 41.66056 | 330 | ZARAGOZA AEROPUERTO | 986.4 | 41 | 1.4 | 25.5 | 1015.2 | 24.4 | 24.4 | 25.4 | 10.3 | 11 | 23.6 | 32.7 | 0 | 31.0 |
| 9434 | -1.004167 | 2023-08-28 19:00:00 | 0 | 249 | 11.5 | 5.8 | 326 | 41.66056 | 303 | ZARAGOZA AEROPUERTO | 986.8 | 47 | 1.5 | 23.6 | 1015.8 | 23.0 | 23.0 | 24.6 | 11.1 | 11 | 11.9 | 31.4 | 0 | 31.2 |
| 9434 | -1.004167 | 2023-08-28 20:00:00 | 0 | 249 | 10.6 | 5.8 | 322 | 41.66056 | 330 | ZARAGOZA AEROPUERTO | 987.1 | 52 | 1.2 | 22.2 | 1016.2 | 21.9 | 21.9 | 23.0 | 11.6 | 11 | 0.0 | 30.3 | 0 | 31.2 |

``` r

Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/rOpenSpain/climaemet",
"issueTracker": "https://github.com/rOpenSpain/climaemet/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "1.1.1.9000",
"version": "1.2.0",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -289,7 +289,7 @@
},
"applicationCategory": "Meteorology",
"isPartOf": "https://ropenspain.es/",
"fileSize": "1052.453KB",
"fileSize": "1046.421KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
2 changes: 1 addition & 1 deletion inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"url": "https://cran.r-project.org"
},
"runtimePlatform": "R version 4.3.1 (2023-06-16 ucrt)",
"version": "1.1.1.9000"
"version": "1.2.0"
},
{
"id": "https://doi.org/10.5281/zenodo.5205573",
Expand Down
4 changes: 2 additions & 2 deletions man/aemet_forecast.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified man/figures/README-spatial-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 15 additions & 16 deletions vignettes/climaemet.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Get started with climaemet 1.0.0"
date: 2023-08-12
date: 2023-08-29
author: <a href="https://orcid.org/0000-0001-8457-4658">Diego Hernangómez <img alt="ORCID logo" src="https://info.orcid.org/wp-content/uploads/2019/11/orcid_24x24.png" width="16" height="16" /></a>
output: rmarkdown::html_vignette
vignette: >
Expand Down Expand Up @@ -88,22 +88,21 @@ See how a tibble is displayed:

aemet_last_obs("9434")
#> # A tibble: 23 × 25
#> idema lon fint prec alt vmax vv dv lat dmax
#> <chr> <dbl> <dttm> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 9434 -1.00 2023-08-11 23:00:00 0 249 4.2 1.6 340 41.7 315
#> 2 9434 -1.00 2023-08-12 00:00:00 0 249 5.7 3.5 299 41.7 305
#> 3 9434 -1.00 2023-08-12 01:00:00 0 249 7 5 285 41.7 275
#> 4 9434 -1.00 2023-08-12 02:00:00 0 249 5.3 2.6 326 41.7 285
#> 5 9434 -1.00 2023-08-12 03:00:00 0 249 4.7 0.9 331 41.7 315
#> 6 9434 -1.00 2023-08-12 04:00:00 0 249 3 2.3 239 41.7 240
#> 7 9434 -1.00 2023-08-12 05:00:00 0 249 2.3 1.5 264 41.7 273
#> 8 9434 -1.00 2023-08-12 06:00:00 0 249 3.2 2.1 260 41.7 263
#> 9 9434 -1.00 2023-08-12 07:00:00 0 249 5 4.1 308 41.7 305
#> 10 9434 -1.00 2023-08-12 08:00:00 0 249 5.2 3.7 319 41.7 313
#> idema lon fint prec alt vmax vv dv lat dmax ubi pres hr stdvv ts
#> <chr> <dbl> <dttm> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 9434 -1.00 2023-08-28 15:00:00 0 249 19.9 11.8 317 41.7 313 ZARAGOZA AER… 987. 42 1.6 31.3
#> 2 9434 -1.00 2023-08-28 16:00:00 0 249 16.4 9.6 317 41.7 320 ZARAGOZA AER… 987. 40 1.7 28.7
#> 3 9434 -1.00 2023-08-28 17:00:00 0 249 15.2 8.8 323 41.7 330 ZARAGOZA AER… 987. 39 1.8 27.5
#> 4 9434 -1.00 2023-08-28 18:00:00 0 249 13 7.3 323 41.7 330 ZARAGOZA AER… 986. 41 1.4 25.5
#> 5 9434 -1.00 2023-08-28 19:00:00 0 249 11.5 5.8 326 41.7 303 ZARAGOZA AER… 987. 47 1.5 23.6
#> 6 9434 -1.00 2023-08-28 20:00:00 0 249 10.6 5.8 322 41.7 330 ZARAGOZA AER… 987. 52 1.2 22.2
#> 7 9434 -1.00 2023-08-28 21:00:00 0 249 12.8 8 323 41.7 325 ZARAGOZA AER… 987. 57 1.5 21.5
#> 8 9434 -1.00 2023-08-28 22:00:00 0 249 11.7 7 325 41.7 335 ZARAGOZA AER… 987. 59 1.3 20.9
#> 9 9434 -1.00 2023-08-28 23:00:00 0 249 11 6.7 298 41.7 310 ZARAGOZA AER… 987. 60 1 20.5
#> 10 9434 -1.00 2023-08-29 00:00:00 0 249 14.2 8.3 290 41.7 303 ZARAGOZA AER… 987. 60 1.3 20.2
#> # ℹ 13 more rows
#> # ℹ 15 more variables: ubi <chr>, pres <dbl>, hr <dbl>, stdvv <dbl>, ts <dbl>,
#> # pres_nmar <dbl>, tamin <dbl>, ta <dbl>, tamax <dbl>, tpr <dbl>,
#> # stddv <dbl>, inso <dbl>, tss5cm <dbl>, pacutp <dbl>, tss20cm <dbl>
#> # ℹ 10 more variables: pres_nmar <dbl>, tamin <dbl>, ta <dbl>, tamax <dbl>, tpr <dbl>, stddv <dbl>, inso <dbl>,
#> # tss5cm <dbl>, pacutp <dbl>, tss20cm <dbl>
```

Note that when possible, data representing dates and numbers are converted to
Expand Down
Binary file modified vignettes/example-gif.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 33 additions & 36 deletions vignettes/extending-climaemet.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -67,46 +67,43 @@ cat(paste("---\n\n", clean, "\n---"))

AGENCIA ESTATAL DE METEOROLOGÍA
PREDICCIÓN GENERAL PARA ESPAÑA
DÍA 11 DE AGOSTO DE 2023 A LAS 08:13 HORA OFICIAL
PREDICCIÓN VÁLIDA PARA EL VIERNES 11
DÍA 23 DE AGOSTO DE 2023 A LAS 08:21 HORA OFICIAL
PREDICCIÓN VÁLIDA PARA EL MIÉRCOLES 23

A.- FENÓMENOS SIGNIFICATIVOS
Temperaturas significativamente altas en Canarias y nordeste,
centro y sur peninsulares, con un descenso notable en el entorno
del Levante. Calima y rachas muy fuertes de viento en Canarias.
Temperaturas significativamente altas en gran parte del país.
Posibilidad de alguna tormenta localmente fuerte en Pirineos.
Intervalos de viento fuerte en el Estrecho.

B.- PREDICCIÓN
En gran parte del país predominarán cielos poco nubosos. No
obstante, un frente atlántico poco activo afectará al extremo
noroeste peninsular, dejando cielos nubosos, que se extenderán de
oeste a este, con precipitaciones en el norte de Galicia y oeste
de Asturias, sin descartarlas en zonas aledañas. Asimismo, se
formará nubosidad de evolución en Pirineos, con posibilidad de
algún chubasco o tormenta aislados, así como en el norte de
Castilla y León y este de la Ibérica, sin descartar alguna
tormenta seca. En Canarias habrá intervalos de nubes medias y
altas.

La calima afectará a las islas Canarias. No se descarta que
también se observe en el sur peninsular, Estrecho y Alborán.
Probables nieblas costeras en el litoral atlántico de Galicia,
Estrecho y Alborán. A lo largo del día podrán formarse brumas
en el interior de Galicia y Asturias.

Las temperaturas máximas tenderán a descender en el tercio este
peninsular y en Baleares, notablemente en Levante. Ascenderán en
Canarias y en la mitad noroeste peninsular. Las mínimas
descenderán en gran parte de la Península, salvo en el noroeste
y Estrecho. Subirán también en los archipiélagos, Ceuta y
Melilla.

En Canarias arreciarán los alisios, con rachas muy fuertes en los
canales entre islas. Nordeste en Baleares, componente este en el
área mediterránea peninsular, tramontana amainando en Ampurdán,
poniente amainando en el Estrecho y, rolando a levante, en
Alborán. Flojos en general en el resto, algo más intensos en
litorales, con componente oeste en la vertiente atlántica en
horas centrales.
En la mayor parte del país predominarán cielos poco nubosos o
despejados con nubes altas, salvo nubes bajas matinales en
litorales de Galicia, Cantábrico occidental, Estrecho, Melilla y
Baleares. No se descarta alguna precipitación matinal en el norte
de Galicia. Por la tarde abundante nubosidad de evolución en
amplias zonas del tercio norte interior, con posibles chubascos y
tormentas dispersos, más probables en montaña, en especial en el
entorno de Pirineos, donde pueden ser localmente fuertes. En
Canarias intervalos nubosos y abundante nubosidad media y alta,
sin descartar algún chubasco o tormenta en las islas de mayor
relieve.

Posibles bancos de nieblas matinales en litorales de Galicia,
Cantábrico y Estrecho, así como calima alta en Canarias.

Temperaturas mínimas en aumento en el tercio noroeste peninsular
y oeste de Andalucía. Máximas en aumento en el extremo norte,
notable en el Cantábrico, incluso extraordinario en el País
Vasco. Sin grandes cambios en el resto, se prevé alcanzar los
34-36 grados en prácticamente todo el interior peninsular y
Baleares, incluso los 38-40 en gran parte de la vertiente
atlántica, depresiones del nordeste y Cantábrico interior.

Levante en Alborán y, con intervalos fuertes, en el Estrecho.
Viento del nordeste en los litorales del noroeste y sudeste. En el
resto vientos flojos, de norte en Canarias, del sureste y sur en
horas centrales gran parte del interior peninsular y variables en
el resto.


---
Expand Down

0 comments on commit efc9e08

Please sign in to comment.