diff --git a/.Rbuildignore b/.Rbuildignore index 09120caa..9d8762fe 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -30,3 +30,4 @@ ^CODE_OF_CONDUCT\.md$ ^CONTRIBUTING\.md$ ^Rplots\.pdf$ +^codecov\.yml$ diff --git a/.github/workflows/rhub.yaml b/.github/workflows/rhub.yaml new file mode 100644 index 00000000..0db497f8 --- /dev/null +++ b/.github/workflows/rhub.yaml @@ -0,0 +1,96 @@ +# R-hub's generic GitHub Actions workflow file. It's canonical location is at +# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml +# You can update this file to a newer version using the rhub2 package: +# +# rhub::rhub_setup() +# +# It is unlikely that you need to modify this file manually. + +name: R-hub +run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}" + +on: + workflow_dispatch: + inputs: + config: + description: 'A comma separated list of R-hub platforms to use.' + type: string + default: 'linux,windows,macos' + name: + description: 'Run name. You can leave this empty now.' + type: string + id: + description: 'Unique ID. You can leave this empty now.' + type: string + +jobs: + + setup: + runs-on: ubuntu-latest + outputs: + containers: ${{ steps.rhub-setup.outputs.containers }} + platforms: ${{ steps.rhub-setup.outputs.platforms }} + + steps: + # NO NEED TO CHECKOUT HERE + - uses: r-hub/actions/setup@v1 + with: + config: ${{ github.event.inputs.config }} + id: rhub-setup + + linux-containers: + needs: setup + if: ${{ needs.setup.outputs.containers != '[]' }} + runs-on: ubuntu-latest + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.containers) }} + container: + image: ${{ matrix.config.container }} + + steps: + - uses: r-hub/actions/checkout@v1 + - uses: r-hub/actions/platform-info@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/setup-deps@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/run-check@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + + other-platforms: + needs: setup + if: ${{ needs.setup.outputs.platforms != '[]' }} + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.platforms) }} + + steps: + - uses: r-hub/actions/checkout@v1 + - uses: r-hub/actions/setup-r@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/actions/platform-info@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/setup-deps@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/actions/run-check@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + diff --git a/CITATION.cff b/CITATION.cff index 10f33d68..d623a91e 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,7 +1,7 @@ -# ----------------------------------------------------------- -# CITATION file created with {cffr} R package, v1.0.0 +# -------------------------------------------- +# CITATION file created with {cffr} R package # See also: https://docs.ropensci.org/cffr/ -# ----------------------------------------------------------- +# -------------------------------------------- cff-version: 1.2.0 message: 'To cite package "tidyBdE" in publications use:' @@ -297,3 +297,4 @@ references: email: hadley@posit.co year: '2024' version: '>= 3.0.0' + diff --git a/README.Rmd b/README.Rmd index 6af02116..81c6dd17 100644 --- a/README.Rmd +++ b/README.Rmd @@ -29,6 +29,7 @@ knitr::opts_chunk$set( [![On-CRAN](https://www.r-pkg.org/badges/ago/tidyBdE)](https://cran.r-project.org/web/checks/check_results_tidyBdE.html) [![r-universe](https://ropenspain.r-universe.dev/badges/tidyBdE)](https://ropenspain.r-universe.dev/tidyBdE) [![R-CMD-check](https://github.com/rOpenSpain/tidyBdE/actions/workflows/check-full.yaml/badge.svg)](https://github.com/rOpenSpain/tidyBdE/actions/workflows/check-full.yaml) +[![R-hub](https://github.com/rOpenSpain/tidyBdE/actions/workflows/rhub.yaml/badge.svg)](https://github.com/rOpenSpain/tidyBdE/actions/workflows/rhub.yaml) [![codecov](https://codecov.io/gh/ropenspain/tidyBdE/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropenspain/tidyBdE) [![CodeFactor](https://www.codefactor.io/repository/github/ropenspain/tidybde/badge)](https://www.codefactor.io/repository/github/ropenspain/tidybde) [![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.4673496-blue)](https://doi.org/10.5281/zenodo.4673496) @@ -55,9 +56,7 @@ install.packages("tidyBdE") You can install the developing version of **tidyBdE** with: ```{r, eval = FALSE} -library(remotes) - -install_github("ropenspain/tidyBdE") +remotes::install_github("ropenspain/tidyBdE") ``` Alternatively, you can install the developing version of **tidyBdE** using the diff --git a/README.md b/README.md index 4b8632e3..dc7f3162 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # tidyBdE @@ -12,25 +11,25 @@ [![On-CRAN](https://www.r-pkg.org/badges/ago/tidyBdE)](https://cran.r-project.org/web/checks/check_results_tidyBdE.html) [![r-universe](https://ropenspain.r-universe.dev/badges/tidyBdE)](https://ropenspain.r-universe.dev/tidyBdE) [![R-CMD-check](https://github.com/rOpenSpain/tidyBdE/actions/workflows/check-full.yaml/badge.svg)](https://github.com/rOpenSpain/tidyBdE/actions/workflows/check-full.yaml) +[![R-hub](https://github.com/rOpenSpain/tidyBdE/actions/workflows/rhub.yaml/badge.svg)](https://github.com/rOpenSpain/tidyBdE/actions/workflows/rhub.yaml) [![codecov](https://codecov.io/gh/ropenspain/tidyBdE/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropenspain/tidyBdE) [![CodeFactor](https://www.codefactor.io/repository/github/ropenspain/tidybde/badge)](https://www.codefactor.io/repository/github/ropenspain/tidybde) [![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.4673496-blue)](https://doi.org/10.5281/zenodo.4673496) -[![Project Status: Active – The project has reached a stable, usable -state and is being actively +[![Project Status: Active – The project has reached a stable, usable state and +is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) **tidyBdE** is an API package that helps to retrieve data from [Banco de España](https://www.bde.es/webbe/en/estadisticas/recursos/descargas-completas.html). -The data is returned as a [`tibble`](https://tibble.tidyverse.org/) and -the package tries to guess the format of every time-series (dates, -characters and numbers). +The data is returned as a [`tibble`](https://tibble.tidyverse.org/) and the +package tries to guess the format of every time-series (dates, characters and +numbers). ## Installation -Install **tidyBdE** from -[**CRAN**](https://CRAN.R-project.org/package=tidyBdE): +Install **tidyBdE** from [**CRAN**](https://CRAN.R-project.org/package=tidyBdE): ``` r install.packages("tidyBdE") @@ -44,8 +43,8 @@ library(remotes) install_github("ropenspain/tidyBdE") ``` -Alternatively, you can install the developing version of **tidyBdE** -using the [r-universe](https://ropenspain.r-universe.dev/tidyBdE): +Alternatively, you can install the developing version of **tidyBdE** using the +[r-universe](https://ropenspain.r-universe.dev/tidyBdE): ``` r # Install tidyBdE in R: @@ -57,12 +56,12 @@ install.packages("tidyBdE", repos = c( ## Examples -Banco de España (**BdE**) provides several time-series, either produced -by the institution itself or compiled for another sources, as +Banco de España (**BdE**) provides several time-series, either produced by the +institution itself or compiled for another sources, as [Eurostat](https://ec.europa.eu/eurostat) or [INE](https://www.ine.es/). -The basic entry point for searching time-series are the catalogs -(*indexes*) of information. You can search any series by name: +The basic entry point for searching time-series are the catalogs (*indexes*) of +information. You can search any series by name: ``` r library(tidyBdE) @@ -86,13 +85,12 @@ XR_GBP %>% |------------------:|:-------------------------------------------------------------------| | 573214 | Tipo de cambio. Libras esterlinas por euro (GBP/EUR).Datos diarios | -**Note that BdE files are only provided in Spanish, for the time -being**, the organism is working on the English version. By now, search -terms should be provided in Spanish in order to get search results. +**Note that BdE files are only provided in Spanish, for the time being**, the +organism is working on the English version. By now, search terms should be +provided in Spanish in order to get search results. -After we have found our series, we can load the series for the GBP/EUR -exchange rate using the sequential number reference -(`Numero_Secuencial`) as: +After we have found our series, we can load the series for the GBP/EUR exchange +rate using the sequential number reference (`Numero_Secuencial`) as: ``` r seq_number <- XR_GBP %>% @@ -111,8 +109,8 @@ time_series <- bde_series_load(seq_number, series_label = "EUR_GBP_XR") %>% ### Plots -The package also provides a custom **ggplot2** theme based on the -publications of BdE: +The package also provides a custom **ggplot2** theme based on the publications +of BdE: ``` r ggplot(time_series, aes(x = Date, y = EUR_GBP_XR)) + @@ -136,11 +134,11 @@ ggplot(time_series, aes(x = Date, y = EUR_GBP_XR)) + theme_tidybde() ``` - + -The package provides also several “shortcut” functions for a selection -of the most relevant macroeconomic series, so there is no need to look -for them in advance: +The package provides also several “shortcut” functions for a selection of the +most relevant macroeconomic series, so there is no need to look for them in +advance: ``` r # Data in "long" format @@ -163,32 +161,30 @@ ggplot(plotseries, aes(x = Date, y = serie_value)) + scale_color_bde_d(palette = "bde_vivid_pal") # Custom palette on the package ``` - + ### Palettes Two custom palettes, based on the used by BdE on some publications are available. -Those palettes can be applied to a `ggplot2` using some custom utils -included on the package (see -`help("scale_color_bde_d", package = "tidyBdE")`). +Those palettes can be applied to a `ggplot2` using some custom utils included on +the package (see `help("scale_color_bde_d", package = "tidyBdE")`). ### A note on caching -You can use **tidyBdE** to create your own local repository at a given -local directory passing the following option: +You can use **tidyBdE** to create your own local repository at a given local +directory passing the following option: ``` r options(bde_cache_dir = "./path/to/location") ``` -When this option is set, **tidyBdE** would look for the cached file on -the `bde_cache_dir` directory and it will load it, speeding up the -process. +When this option is set, **tidyBdE** would look for the cached file on the +`bde_cache_dir` directory and it will load it, speeding up the process. -It is possible to update the data (i.e. after every monthly or quarterly -data release) with the following commands: +It is possible to update the data (i.e. after every monthly or quarterly data +release) with the following commands: ``` r bde_catalog_update() @@ -202,36 +198,35 @@ bde_series_load("SOME ID", update_cache = TRUE) Other useful packages that provides access to Spanish open data: -- [**MicroDatosEs**](https://github.com/rOpenSpain/MicroDatosEs): A - package that process microdata provided by Spanish statistical - agencies (mostly, INE). -- [**CatastRo**](https://github.com/rOpenSpain/CatastRo): A package that - queries Sede electrónica del Catastro API. -- [**mapSpain**](https://ropenspain.github.io/mapSpain/): For - downloading geospatial information from Instituto Geográfico Nacional - (IGN) and creating maps of Spain. +- [**MicroDatosEs**](https://github.com/rOpenSpain/MicroDatosEs): A package + that process microdata provided by Spanish statistical agencies (mostly, + INE). +- [**CatastRo**](https://github.com/rOpenSpain/CatastRo): A package that + queries Sede electrónica del Catastro API. +- [**mapSpain**](https://ropenspain.github.io/mapSpain/): For downloading + geospatial information from Instituto Geográfico Nacional (IGN) and creating + maps of Spain. ## Disclaimer -This package is in no way sponsored endorsed or administered by Banco de -España. +This package is in no way sponsored endorsed or administered by Banco de España. ## Citation -

-H. Herrero D (2024). tidyBdE: Download Data from Bank of Spain. +

H. Herrero D (2024). tidyBdE: Download Data from Bank of Spain. doi:10.5281/zenodo.4673496, -https://ropenspain.github.io/tidyBdE/. -

+https://ropenspain.github.io/tidyBdE/.

A BibTeX entry for LaTeX users is - @Manual{R-tidyBdE, - title = {{tidyBdE}: Download Data from Bank of Spain}, - doi = {10.5281/zenodo.4673496}, - author = {Diego {H. Herrero}}, - year = {2024}, - version = {0.3.5.9000}, - url = {https://ropenspain.github.io/tidyBdE/}, - abstract = {Tools to download data series from Banco de España (BdE) on tibble format. Banco de España is the national central bank and, within the framework of the Single Supervisory Mechanism (SSM), the supervisor of the Spanish banking system along with the European Central Bank. This package is in no way sponsored endorsed or administered by Banco de España.}, - } +``` +@Manual{R-tidyBdE, + title = {{tidyBdE}: Download Data from Bank of Spain}, + doi = {10.5281/zenodo.4673496}, + author = {Diego {H. Herrero}}, + year = {2024}, + version = {0.3.5.9000}, + url = {https://ropenspain.github.io/tidyBdE/}, + abstract = {Tools to download data series from Banco de España (BdE) on tibble format. Banco de España is the national central bank and, within the framework of the Single Supervisory Mechanism (SSM), the supervisor of the Spanish banking system along with the European Central Bank. This package is in no way sponsored endorsed or administered by Banco de España.}, +} +``` diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..af67188c --- /dev/null +++ b/codecov.yml @@ -0,0 +1,3 @@ +codecov: + token: ebd5e3f5-b5e5-4a82-8e65-e347d1392d38 + diff --git a/codemeta.json b/codemeta.json index 91b7da91..07f5165b 100644 --- a/codemeta.json +++ b/codemeta.json @@ -192,7 +192,7 @@ }, "applicationCategory": "Macroeconomics", "isPartOf": "https://ropenspain.es/", - "fileSize": "289.392KB", + "fileSize": "289.071KB", "citation": [ { "@type": "SoftwareSourceCode",