Skip to content

Commit

Permalink
Prepare CRAN release
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Aug 4, 2021
1 parent c7d21f4 commit df595fb
Show file tree
Hide file tree
Showing 24 changed files with 78 additions and 81 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tidyBdE
Title: Download Data from Bank of Spain
Version: 0.1.2.9011
Version: 0.2.0
Authors@R:
c(person(given = "Diego",
family = "H. Herrero",
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# tidyBdE (development version)
# tidyBdE 0.2.0
- Add series index article.
- Add new series: `bde_ind_gdp_quarterly()`, `bde_ind_population()`.
- Improve package coverage and docs.
- Move tests to `testthat`.

- The following scales have been removed: `bde_scale_colour_vivid()`, `bde_scale_color_vivid()`, `bde_scale_fill_vivid()`, `bde_scale_colour_rose()`, `bde_scale_color_rose()` `bde_scale_fill_rose()`. Use `scale_color_bde_c()`
instead.

# tidyBdE 0.1.2

Expand Down
22 changes: 10 additions & 12 deletions R/catalogs.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#' Load BdE catalogs
#'
#' Load the time-series catalogs provided by BdE.
#' @export
#'
#' @concept catalog
#'
#' @encoding UTF-8
#'
#' @description Load the time-series catalogs provided by BdE.
#'
#' @return A tibble
#'
#' @seealso [bde_catalog_update()]
Expand All @@ -17,10 +16,10 @@
#' @param catalog A single value indicating the catalogs to be updated
#' or "ALL" as a shorthand. See Details
#'
#' @param parse_dates Logical. If TRUE the dates would be parsed using
#' @param parse_dates Logical. If `TRUE` the dates would be parsed using
#' [bde_parse_dates()].
#'
#' @param update_cache Logical. If TRUE the requested file would be updated on
#' @param update_cache Logical. If `TRUE` the requested file would be updated on
#' the `cache_dir`.
#'
#' @inheritParams bde_catalog_update
Expand Down Expand Up @@ -194,15 +193,15 @@ bde_catalog_load <-

#' Update BdE catalogs
#'
#' Update the time-series catalogs provided by BdE.
#'
#' @export
#'
#' @concept catalog
#'
#' @encoding UTF-8
#'
#' @description Update the time-series catalogs provided by BdE.
#'
#' @return Silent. Downloads the catalog file(s) to the local machine.
#' @return None Downloads the catalog file(s) to the local machine.
#'
#' @source [Time-series bulk data download](https://www.bde.es/webbde/en/estadis/infoest/descarga_series_temporales.html)
#'
Expand Down Expand Up @@ -307,13 +306,12 @@ bde_catalog_update <-

#' Search BdE catalogs
#'
#' Search for keywords on the time-series catalogs.
#'
#' @export
#'
#' @concept catalog
#'
#' @description
#' Search for keywords on the time-series catalogs.
#'
#' @return A tibble with the results of the query.
#'
#' @param pattern regex pattern to search See Details and Examples.
Expand All @@ -327,11 +325,11 @@ bde_catalog_update <-
#' Spanish, for the time being. Therefore search terms should be provided
#' in Spanish as well in order to get search results.
#'
#' This function uses [`grep()`][base::grep()] function for finding matches on
#' This function uses [base::grep()] function for finding matches on
#' the catalogs. You can pass [regular expressions][base::grep()] to broaden
#' the search.
#'
#' @seealso [bde_catalog_load()], [`grep()`][base::grep()]
#' @seealso [bde_catalog_load()], [base::grep()]
#'
#' @examples
#' \donttest{
Expand Down
4 changes: 2 additions & 2 deletions R/indicators.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#'
#' @details
#' This functions are convenient wrappers of [bde_series_load()] referencing
#' specific series. Use `verbose = TRUE/extract_metadata = TRUE` to see the
#' specification and the source.
#' specific series. Use `verbose = TRUE, extract_metadata = TRUE` options
#' to see the specification and the source.
#'
#' @examples
#' \donttest{
Expand Down
5 changes: 3 additions & 2 deletions R/scales.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#' Scales to be used with the `ggplot2` package. Discrete palettes are named
#' as `scale_*_bde_d` while continuous palettes are named `scale_*_bde_c`.
#'
#' @seealso [bde_vivid_pal()]
#' @seealso [bde_vivid_pal()], [ggplot2::discrete_scale()],
#' [ggplot2::continuous_scale()]
#'
#' @concept bde_plot
#'
Expand All @@ -21,7 +22,7 @@
#' "bde_rose_pal". See [bde_vivid_pal()] for details.
#'
#' @param ... Further arguments of [ggplot2::discrete_scale()] or
#' [ggplot2::continuous_scale()]
#' [ggplot2::continuous_scale()].
#'
scale_color_bde_d <- function(palette = "bde_vivid_pal",
...) { # nocov start
Expand Down
20 changes: 11 additions & 9 deletions R/series.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#' Load a single BdE time-series.
#'
#' Load a single time-series provided by BdE.
#'
#' @export
#'
#' @concept series
#'
#' @description Load a single time-series provided by BdE.
#'
#' @encoding UTF-8
#'
Expand Down Expand Up @@ -166,9 +167,6 @@ bde_series_load <- function(series_code,
#'
#' @export
#'
#' @concept series
#'
#' @seealso [bde_series_load()]
#'
#' @description
#' Load a full time-series file provided by BdE.
Expand All @@ -177,12 +175,16 @@ bde_series_load <- function(series_code,
#'
#' The series name is a positional code showing the location of the table. For
#' example, table **be_6_1** represents the Table 1, Chapter 6 of the
#' Statistical Bulletin. Although it is a unique value, it is subject to
#' change (i.e. a new table is inserted before).
#' Statistical Bulletin ("BE"). Although it is a unique value, it is subject
#' to change (i.e. a new table is inserted before).
#'
#' For that reason, the function [bde_series_load()] is more suitable for
#' extracting specific time-series.
#'
#' @concept series
#'
#' @seealso [bde_series_load()]
#'
#' @encoding UTF-8
#'
#' @param series_csv csv file of a series, as defined in the field
Expand All @@ -191,10 +193,10 @@ bde_series_load <- function(series_code,
#'
#' @inheritParams bde_catalog_load
#'
#' @param parse_numeric Logical. If TRUE the columns would be parsed to double
#' (numeric) values. See Note.
#' @param parse_numeric Logical. If `TRUE` the columns would be parsed to
#' double (numeric) values. See Note.
#'
#' @param extract_metadata Logical TRUE/FALSE. On TRUE the output is the
#' @param extract_metadata Logical `TRUE/FALSE`. On `TRUE` the output is the
#' metadata of the requested series.
#'
#' @return A tibble with a field "Date" and the alias of the fields series as
Expand Down
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Alternatively, you can install the developing version of `tidyBdE` using
the [r-universe](https://ropenspain.r-universe.dev/ui#builds):

``` r

# Enable this universe
options(repos = c(
ropenspain = "https://ropenspain.r-universe.dev",
Expand All @@ -68,17 +67,16 @@ The basic entry point for searching time-series are the catalogs
(*indexes*) of information. You can search any series by name:

``` r

library(tidyBdE)

# Search GBP on "TC" (exchange rate) catalog
XR_GBP <- bde_catalog_search("GBP", catalog = "TC")

XR_GBP[c(2, 5)]
#> # A tibble: 1 × 2
#> # A tibble: 1 x 2
#> Numero_secuencial Descripcion_de_la_serie
#> <dbl> <chr>
#> 1 573214 Tipo de cambio. Libras esterlinas por euro (GBP/EUR).Datos
#> 1 573214 Tipo de cambio. Libras esterlinas por euro (GBP/EUR).Datos ~
```

**Note that BdE files are only provided in Spanish, for the time
Expand All @@ -90,7 +88,6 @@ exchange rate using the sequential number reference
(`Numero_Secuencial`) as:

``` r

# Load tidyverse for better handling
library(tidyverse)

Expand All @@ -103,7 +100,6 @@ 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)) +
geom_line(colour = bde_vivid_pal()(1)) +
geom_smooth(method = "gam", colour = bde_vivid_pal()(2)[2]) +
Expand Down Expand Up @@ -133,7 +129,6 @@ of the most relevant macroeconomic series, so there is no need to look
for them in advance:

``` r

gdp <- bde_ind_gdp_var("values")
gdp$label <- "GDP YoY"

Expand Down Expand Up @@ -161,7 +156,6 @@ Two custom palettes, based on the used by BdE on some publications are
available.

``` r

opar <- par(no.readonly = TRUE)

par(mfrow = c(1, 2))
Expand All @@ -174,13 +168,12 @@ title("bde_vivid_pal()")
<img src="man/figures/README-palettes-1.png" width="100%" />

``` r

par(opar)
```

Those palettes can be applied to a `ggplot2` using some custom utils
included on the package (see `help("scale_color_bde_d", package =
"tidyBdE")`).
included on the package (see
`help("scale_color_bde_d", package = "tidyBdE")`).

``` r
# Load GDP Series
Expand Down Expand Up @@ -279,12 +272,12 @@ 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
- [**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
- [**CatastRo**](https://github.com/rOpenSpain/CatastRo): A package
that queries Sede electrónica del Catastro API.
- [**mapSpain**](https://ropenspain.github.io/mapSpain/): For
- [**mapSpain**](https://ropenspain.github.io/mapSpain/): For
downloading geospatial information from Instituto Geográfico
Nacional (IGN) and creating maps of Spain.

Expand All @@ -301,7 +294,7 @@ citation("tidyBdE")
#> To cite tidyBdE in publications use:
#>
#> Herrero, D. H. (2021). tidyBdE: Download Data from Bank of Spain. R
#> package version 0.1.2.9011. https://doi.org/10.5281/zenodo.4673496.
#> package version 0.2.0. https://doi.org/10.5281/zenodo.4673496.
#> Package url: https://CRAN.R-project.org/package=tidyBdE
#>
#> A BibTeX entry for LaTeX users is
Expand All @@ -310,7 +303,7 @@ citation("tidyBdE")
#> title = {tidyBdE: Download Data from Bank of Spain},
#> author = {D. H. Herrero},
#> year = {2021},
#> note = {R package version 0.1.2.9011},
#> note = {R package version 0.2.0},
#> doi = {10.5281/zenodo.4673496},
#> url = {https://CRAN.R-project.org/package=tidyBdE},
#> }
Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"issueTracker": "https://github.com/rOpenSpain/tidyBdE/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.2.9011",
"version": "0.2.0",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -192,7 +192,7 @@
],
"releaseNotes": "https://github.com/rOpenSpain/tidyBdE/blob/master/NEWS.md",
"readme": "https://github.com/rOpenSpain/tidyBdE/blob/main/README.md",
"fileSize": "630.973KB",
"fileSize": "573.582KB",
"contIntegration": ["https://github.com/rOpenSpain/tidyBdE/actions/workflows/check-full.yaml", "https://codecov.io/gh/ropenspain/tidyBdE"],
"developmentStatus": "https://www.repostatus.org/#active",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"url": "https://cran.r-project.org"
},
"runtimePlatform": "R version 4.1.0 (2021-05-18)",
"version": "0.1.2.9011"
"version": "0.2.0"
},
{
"id": "https://doi.org/10.5281/zenodo.4673496",
Expand Down
4 changes: 2 additions & 2 deletions man/bde_catalog_load.Rd

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

8 changes: 4 additions & 4 deletions man/bde_catalog_search.Rd

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

2 changes: 1 addition & 1 deletion man/bde_catalog_update.Rd

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

Loading

0 comments on commit df595fb

Please sign in to comment.