From 76ca57918308f0acafd96827b41750964d90b793 Mon Sep 17 00:00:00 2001 From: Diego H Date: Mon, 18 Mar 2024 19:41:26 +0100 Subject: [PATCH 1/6] Update docs --- DESCRIPTION | 4 ++-- NEWS.md | 5 +++++ R/bde_check_access.R | 2 +- R/catalogs.R | 4 ++-- R/scales.R | 13 +++++-------- R/series.R | 2 +- R/theme_tidybde.R | 4 ++-- R/utils.R | 2 +- 8 files changed, 19 insertions(+), 17 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c8d08c85..ac3f5d99 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tidyBdE Title: Download Data from Bank of Spain -Version: 0.3.5 +Version: 0.3.5.9000 Authors@R: person("Diego", "H. Herrero", , "dev.dieghernan@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0001-8457-4658", affiliation = "rOpenSpain")) @@ -18,7 +18,7 @@ Depends: R (>= 3.6.0) Imports: dplyr (>= 0.7.0), - ggplot2 (>= 3.3.0), + ggplot2 (>= 3.5.0), readr (>= 1.0.0), scales (>= 1.1.0), tibble (>= 3.0.0), diff --git a/NEWS.md b/NEWS.md index 40d677a2..49d09545 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# tidyBdE (development version) + +- Adapt `scale_color_bde_d()` and friends to **ggplot2** 3.5.0. Also + expose the `guide` argument instead of hard-coding it. + # tidyBdE 0.3.5 Mostly changes on the color functions: diff --git a/R/bde_check_access.R b/R/bde_check_access.R index b1c3592c..91c94096 100644 --- a/R/bde_check_access.R +++ b/R/bde_check_access.R @@ -1,7 +1,7 @@ #' Check access to BdE #' #' @description -#' Check if R has access to resources at +#' Check if **R** has access to resources at #' . #' #' @return a logical. diff --git a/R/catalogs.R b/R/catalogs.R index a57c09f6..d8ee104a 100644 --- a/R/catalogs.R +++ b/R/catalogs.R @@ -9,7 +9,7 @@ #' #' @encoding UTF-8 #' -#' @return A [tibble][tibble::tibble]. +#' @return A [`tibble`][tibble::tibble] object. #' #' @source #' [Time-series bulk data @@ -301,7 +301,7 @@ bde_catalog_update <- function(catalog = c("ALL", "BE", "SI", "TC", "TI", "PB"), #' #' @family catalog #' -#' @return A [tibble][tibble::tibble] with the results of the query. +#' @return A [`tibble`][tibble::tibble] object with the results of the query. #' #' @param pattern [`regex`][base::regex] pattern to search See **Details** #' and **Examples**. diff --git a/R/scales.R b/R/scales.R index 857f7166..8426563e 100644 --- a/R/scales.R +++ b/R/scales.R @@ -21,6 +21,7 @@ #' for details. #' #' @inheritParams bde_tidy_palettes +#' @inheritParams ggplot2::continuous_scale #' #' @param ... Further arguments of [ggplot2::discrete_scale()] or #' [ggplot2::continuous_scale()]. @@ -59,7 +60,6 @@ scale_color_bde_d <- function( ggplot2::discrete_scale( aesthetics = "color", palette = pal, - scale_name = palette, ... ) } @@ -84,7 +84,6 @@ scale_fill_bde_d <- function( ggplot2::discrete_scale( aesthetics = "fill", palette = pal, - scale_name = palette, ... ) } @@ -95,7 +94,7 @@ scale_fill_bde_d <- function( #' @export scale_color_bde_c <- function( palette = c("bde_rose_pal", "bde_vivid_pal", "bde_qual_pal"), alpha = NULL, - rev = FALSE, ...) { + rev = FALSE, guide = "colorbar", ...) { palette <- match.arg(palette) @@ -115,9 +114,8 @@ scale_color_bde_c <- function( ) ggplot2::continuous_scale( aesthetics = "color", - scale_name = palette, palette = scales::gradient_n_pal(cols), - guide = "colorbar", + guide = guide, ... ) } @@ -133,7 +131,7 @@ scale_colour_bde_c <- scale_color_bde_c #' @export scale_fill_bde_c <- function( palette = c("bde_rose_pal", "bde_vivid_pal", "bde_qual_pal"), alpha = NULL, - rev = FALSE, ...) { + rev = FALSE, guide = "colorbar", ...) { palette <- match.arg(palette) @@ -153,9 +151,8 @@ scale_fill_bde_c <- function( ) ggplot2::continuous_scale( aesthetics = "fill", - scale_name = palette, palette = scales::gradient_n_pal(cols), - guide = "colorbar", + guide = guide, ... ) } diff --git a/R/series.R b/R/series.R index f12aa626..c6ebde04 100644 --- a/R/series.R +++ b/R/series.R @@ -24,7 +24,7 @@ #' #' #' @return -#' A [tibble][tibble::tibble] with a field `Date` and : +#' A [`tibble`][tibble::tibble] with a field `Date` and : #' - With `out_format = "wide"` each series is presented in a separate #' column with the name defined by `series_label`. #' - With `out_format = "long"` the tibble would have two more columns, diff --git a/R/theme_tidybde.R b/R/theme_tidybde.R index b5826380..e77e77b4 100644 --- a/R/theme_tidybde.R +++ b/R/theme_tidybde.R @@ -1,4 +1,4 @@ -#' BdE `ggplot2` theme +#' BdE \CRANpkg{ggplot2} theme #' #' A custom \CRANpkg{ggplot2} theme based on the publications of BdE. #' @@ -6,7 +6,7 @@ #' #' @export #' -#' @return A [ggplot2::theme_classic()]. +#' @return A \CRANpkg{ggplot2} [`theme()`][ggplot2::theme_classic()]. #' #' @inheritDotParams ggplot2::theme_classic #' diff --git a/R/utils.R b/R/utils.R index 25ffcc7e..89c1bdfd 100644 --- a/R/utils.R +++ b/R/utils.R @@ -6,7 +6,7 @@ #' #' @family utils #' -#' @return A class "Date" object. +#' @return A [`Date`][as.Date()] object. #' #' @seealso [as.Date()] #' From bb1474b716fe37916b33823d7c55a5444e10ea99 Mon Sep 17 00:00:00 2001 From: dieghernan Date: Mon, 18 Mar 2024 18:44:10 +0000 Subject: [PATCH 2/6] Update CITATION.cff --- CITATION.cff | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 2f481dbf..10f33d68 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ message: 'To cite package "tidyBdE" in publications use:' type: software license: GPL-3.0-or-later title: 'tidyBdE: Download Data from Bank of Spain' -version: 0.3.5 +version: 0.3.5.9000 doi: 10.5281/zenodo.4673496 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 @@ -32,7 +32,7 @@ preferred-citation: affiliation: rOpenSpain doi: 10.5281/zenodo.4673496 year: '2024' - version: 0.3.5 + 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 @@ -136,7 +136,7 @@ references: name-particle: van den orcid: https://orcid.org/0000-0002-9335-7468 year: '2024' - version: '>= 3.3.0' + version: '>= 3.5.0' - type: software title: readr abstract: 'readr: Read Rectangular Text Data' From db17468e96ed2b4e05d87d5805dec11c42594e6c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 18:56:44 +0000 Subject: [PATCH 3/6] Update docs with pkgdev --- README.md | 2 +- codemeta.json | 6 +++--- inst/schemaorg.json | 2 +- man/bde_catalog_load.Rd | 2 +- man/bde_catalog_search.Rd | 2 +- man/bde_check_access.Rd | 2 +- man/bde_parse_dates.Rd | 2 +- man/bde_series_load.Rd | 2 +- man/scales_bde.Rd | 5 +++++ man/theme_tidybde.Rd | 4 ++-- 10 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 940fb571..8ee95739 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,7 @@ A BibTeX entry for LaTeX users is doi = {10.5281/zenodo.4673496}, author = {Diego {H. Herrero}}, year = {2024}, - version = {0.3.5}, + 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/codemeta.json b/codemeta.json index 26d94e20..48826dea 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/rOpenSpain/tidyBdE", "issueTracker": "https://github.com/rOpenSpain/tidyBdE/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.3.5", + "version": "0.3.5.9000", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -123,7 +123,7 @@ "@type": "SoftwareApplication", "identifier": "ggplot2", "name": "ggplot2", - "version": ">= 3.3.0", + "version": ">= 3.5.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -192,7 +192,7 @@ }, "applicationCategory": "Macroeconomics", "isPartOf": "https://ropenspain.es/", - "fileSize": "288.623KB", + "fileSize": "289.078KB", "citation": [ { "@type": "SoftwareSourceCode", diff --git a/inst/schemaorg.json b/inst/schemaorg.json index 1c963452..61172710 100644 --- a/inst/schemaorg.json +++ b/inst/schemaorg.json @@ -29,7 +29,7 @@ "url": "https://cran.r-project.org" }, "runtimePlatform": "R version 4.3.3 (2024-02-29 ucrt)", - "version": "0.3.5" + "version": "0.3.5.9000" }, { "id": "https://doi.org/10.5281/zenodo.4673496", diff --git a/man/bde_catalog_load.Rd b/man/bde_catalog_load.Rd index b631b083..35c96473 100644 --- a/man/bde_catalog_load.Rd +++ b/man/bde_catalog_load.Rd @@ -33,7 +33,7 @@ the \code{cache_dir}.} debugging.} } \value{ -A \link[tibble:tibble]{tibble}. +A \code{\link[tibble:tibble]{tibble}} object. } \description{ Load the time-series catalogs provided by BdE. diff --git a/man/bde_catalog_search.Rd b/man/bde_catalog_search.Rd index aaa95c13..c1454890 100644 --- a/man/bde_catalog_search.Rd +++ b/man/bde_catalog_search.Rd @@ -27,7 +27,7 @@ debugging.} }} } \value{ -A \link[tibble:tibble]{tibble} with the results of the query. +A \code{\link[tibble:tibble]{tibble}} object with the results of the query. } \description{ Search for keywords on the time-series catalogs. diff --git a/man/bde_check_access.Rd b/man/bde_check_access.Rd index ea4f77a9..2bd81bcf 100644 --- a/man/bde_check_access.Rd +++ b/man/bde_check_access.Rd @@ -10,7 +10,7 @@ bde_check_access() a logical. } \description{ -Check if R has access to resources at +Check if \strong{R} has access to resources at \url{https://www.bde.es/webbe/en/estadisticas/recursos/descargas-completas.html}. } \examples{ diff --git a/man/bde_parse_dates.Rd b/man/bde_parse_dates.Rd index 6ae50421..22e206ce 100644 --- a/man/bde_parse_dates.Rd +++ b/man/bde_parse_dates.Rd @@ -10,7 +10,7 @@ bde_parse_dates(dates_to_parse) \item{dates_to_parse}{Dates to parse} } \value{ -A class "Date" object. +A \code{\link[=as.Date]{Date}} object. } \description{ This function is tailored for the date formatting used on this package, so diff --git a/man/bde_series_load.Rd b/man/bde_series_load.Rd index 36552c87..3aea0f81 100644 --- a/man/bde_series_load.Rd +++ b/man/bde_series_load.Rd @@ -49,7 +49,7 @@ debugging.} metadata of the requested series.} } \value{ -A \link[tibble:tibble]{tibble} with a field \code{Date} and : +A \code{\link[tibble:tibble]{tibble}} with a field \code{Date} and : \itemize{ \item With \code{out_format = "wide"} each series is presented in a separate column with the name defined by \code{series_label}. diff --git a/man/scales_bde.Rd b/man/scales_bde.Rd index 9a0a4b76..6e0e2f6a 100644 --- a/man/scales_bde.Rd +++ b/man/scales_bde.Rd @@ -28,6 +28,7 @@ scale_color_bde_c( palette = c("bde_rose_pal", "bde_vivid_pal", "bde_qual_pal"), alpha = NULL, rev = FALSE, + guide = "colorbar", ... ) @@ -35,6 +36,7 @@ scale_fill_bde_c( palette = c("bde_rose_pal", "bde_vivid_pal", "bde_qual_pal"), alpha = NULL, rev = FALSE, + guide = "colorbar", ... ) } @@ -52,6 +54,9 @@ reversed.} \item{...}{Further arguments of \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale()}} or \code{\link[ggplot2:continuous_scale]{ggplot2::continuous_scale()}}.} + +\item{guide}{A function used to create a guide or its name. See +\code{\link[ggplot2:guides]{guides()}} for more information.} } \value{ A \CRANpkg{ggplot2} color scale. diff --git a/man/theme_tidybde.Rd b/man/theme_tidybde.Rd index fb800f21..f72c3e85 100644 --- a/man/theme_tidybde.Rd +++ b/man/theme_tidybde.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/theme_tidybde.R \name{theme_tidybde} \alias{theme_tidybde} -\title{BdE \code{ggplot2} theme} +\title{BdE \CRANpkg{ggplot2} theme} \usage{ theme_tidybde(...) } @@ -17,7 +17,7 @@ theme_tidybde(...) }} } \value{ -A \code{\link[ggplot2:ggtheme]{ggplot2::theme_classic()}}. +A \CRANpkg{ggplot2} \code{\link[ggplot2:ggtheme]{theme()}}. } \description{ A custom \CRANpkg{ggplot2} theme based on the publications of BdE. From a6f03632ee89fe0d822938ff066f45a51ea98c0d Mon Sep 17 00:00:00 2001 From: Diego H Date: Mon, 18 Mar 2024 20:08:47 +0100 Subject: [PATCH 4/6] Remove dots --- R/scales.R | 2 +- R/series.R | 2 +- man/bde_series_load.Rd | 2 +- man/scales_bde.Rd | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/scales.R b/R/scales.R index 8426563e..0db132ee 100644 --- a/R/scales.R +++ b/R/scales.R @@ -1,4 +1,4 @@ -#' BdE scales for \CRANpkg{ggplot2}. +#' BdE scales for \CRANpkg{ggplot2} #' #' @description #' diff --git a/R/series.R b/R/series.R index c6ebde04..b5a89db6 100644 --- a/R/series.R +++ b/R/series.R @@ -1,4 +1,4 @@ -#' Load a single BdE time-series. +#' Load a single BdE time-series #' #' Load a single time-series provided by BdE. #' diff --git a/man/bde_series_load.Rd b/man/bde_series_load.Rd index 3aea0f81..0c7a2f0c 100644 --- a/man/bde_series_load.Rd +++ b/man/bde_series_load.Rd @@ -3,7 +3,7 @@ \encoding{UTF-8} \name{bde_series_load} \alias{bde_series_load} -\title{Load a single BdE time-series.} +\title{Load a single BdE time-series} \usage{ bde_series_load( series_code, diff --git a/man/scales_bde.Rd b/man/scales_bde.Rd index 6e0e2f6a..7e37c891 100644 --- a/man/scales_bde.Rd +++ b/man/scales_bde.Rd @@ -8,7 +8,7 @@ \alias{scale_color_bde_c} \alias{scale_colour_bde_c} \alias{scale_fill_bde_c} -\title{BdE scales for \CRANpkg{ggplot2}.} +\title{BdE scales for \CRANpkg{ggplot2}} \usage{ scale_color_bde_d( palette = c("bde_vivid_pal", "bde_rose_pal", "bde_qual_pal"), From 5c0075f6db0d2bb1e1ccde122fc832ef27b1c12d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 19:16:07 +0000 Subject: [PATCH 5/6] Update docs with pkgdev --- codemeta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codemeta.json b/codemeta.json index 48826dea..3c30e6f4 100644 --- a/codemeta.json +++ b/codemeta.json @@ -192,7 +192,7 @@ }, "applicationCategory": "Macroeconomics", "isPartOf": "https://ropenspain.es/", - "fileSize": "289.078KB", + "fileSize": "289.079KB", "citation": [ { "@type": "SoftwareSourceCode", From 68aeb1eab0b8847dc99915aa2e83c6547e563170 Mon Sep 17 00:00:00 2001 From: Diego H Date: Mon, 18 Mar 2024 20:34:06 +0100 Subject: [PATCH 6/6] Add moar packages --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index ac3f5d99..c6f18a6e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -33,7 +33,7 @@ VignetteBuilder: knitr Config/Needs/coverage: covr Config/Needs/website: reactable, styler, tidyverse, - ropenspain/rostemplate, devtools + ropenspain/rostemplate, devtools, cpp11, remotes Config/testthat/edition: 3 Config/testthat/parallel: true Copyright: See file inst/COPYRIGHTS