Skip to content

Commit

Permalink
Update code series
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Jul 11, 2024
1 parent 6127155 commit dbebb4a
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 95 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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.6
version: 0.3.6.9000
doi: 10.32614/CRAN.package.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
Expand All @@ -32,7 +32,7 @@ preferred-citation:
affiliation: rOpenSpain
doi: 10.32614/CRAN.package.tidyBdE
year: '2024'
version: 0.3.6
version: 0.3.6.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
Expand Down
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.3.6
Version: 0.3.6.9000
Authors@R:
person("Diego", "H. Herrero", , "[email protected]", role = c("aut", "cre", "cph"),
comment = c(ORCID = "0000-0001-8457-4658", affiliation = "rOpenSpain"))
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# tidyBdE (development version)

- Update `bde_ind_unemployment_rate()` since the underlying identifier
changed.
- `bde_ind_population()` under review, not providing results as of July 2024.
- DOI changed to **CRAN** url:
<https://doi.org/10.32614/CRAN.package.tidyBdE>.

# tidyBdE 0.3.6

- Adapt `scale_color_bde_d()` and friends to **ggplot2** 3.5.0. Also expose
Expand Down
19 changes: 11 additions & 8 deletions R/indicators.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bde_ind_gdp_var <- function(series_label = "GDP_YoY", ...) {
#' @export
bde_ind_unemployment_rate <-
function(series_label = "Unemployment_Rate", ...) {
seq_num <- 2357793
seq_num <- 4635980

econom_ind <-
bde_series_load(seq_num, series_label = series_label, ...)
Expand Down Expand Up @@ -141,13 +141,16 @@ bde_ind_gdp_quarterly <- function(series_label = "GDP_quarterly_value", ...) {
#'
#' @export
bde_ind_population <- function(series_label = "Population_Spain", ...) {
seq_num <- 3078287

econom_ind <-
bde_series_load(seq_num, series_label = series_label, ...)
econom_ind <- econom_ind[!is.na(econom_ind[[2]]), ]

return(econom_ind)
# seq_num <- 3078287

Check warning on line 144 in R/indicators.R

View workflow job for this annotation

GitHub Actions / Run lintr scanning

file=R/indicators.R,line=144,col=5,[commented_code_linter] Commented code should be removed.
#
# econom_ind <-
# bde_series_load(seq_num, series_label = series_label, ...)

Check warning on line 147 in R/indicators.R

View workflow job for this annotation

GitHub Actions / Run lintr scanning

file=R/indicators.R,line=147,col=7,[commented_code_linter] Commented code should be removed.
# econom_ind <- econom_ind[!is.na(econom_ind[[2]]), ]

Check warning on line 148 in R/indicators.R

View workflow job for this annotation

GitHub Actions / Run lintr scanning

file=R/indicators.R,line=148,col=5,[commented_code_linter] Commented code should be removed.
#
# return(econom_ind)

Check warning on line 150 in R/indicators.R

View workflow job for this annotation

GitHub Actions / Run lintr scanning

file=R/indicators.R,line=150,col=5,[commented_code_linter] Commented code should be removed.

message("Under review")
return(NULL)
}

#' @export
Expand Down
6 changes: 3 additions & 3 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"codeRepository": "https://github.com/rOpenSpain/tidyBdE",
"issueTracker": "https://github.com/rOpenSpain/tidyBdE/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.3.6",
"version": "0.3.6.9000",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.4.1 (2024-06-14 ucrt)",
"runtimePlatform": "R version 4.4.1 (2024-06-14)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -192,7 +192,7 @@
},
"applicationCategory": "Macroeconomics",
"isPartOf": "https://ropenspain.es/",
"fileSize": "289.593KB",
"fileSize": "285.823KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
4 changes: 2 additions & 2 deletions inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"runtimePlatform": "R version 4.4.1 (2024-06-14 ucrt)",
"version": "0.3.6"
"runtimePlatform": "R version 4.4.1 (2024-06-14)",
"version": "0.3.6.9000"
},
{
"id": "https://doi.org/10.32614/CRAN.package.tidyBdE",
Expand Down
Binary file modified man/figures/README-chart-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions tests/testthat/test-indicators.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ test_that("Indicators", {
n7 <- expect_silent(bde_ind_gdp_quarterly())
expect_true(nrow(n7) > 10)

n8 <- expect_silent(bde_ind_population())
expect_true(nrow(n8) > 10)

n9 <- expect_silent(bde_ind_ibex_daily())
expect_true(nrow(n9) > 10)
})
76 changes: 0 additions & 76 deletions vignettes/articles/Main_Macroeconomic_Series.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -101,49 +101,6 @@ ggplot(dataset, aes(x = Date, y = data)) +
theme_tidybde()
```

### GDP per capita

```{r echo=FALSE}
pop <- bde_ind_population(series_label = "pop")
pib <- bde_ind_gdp_quarterly(series_label = "data")
pib$LastY <- pib$data + lag(pib$data, 1) + lag(pib$data, 2) + lag(pib$data, 3)
pib <- inner_join(pib, pop, by = "Date")
pib <- pib %>% mutate(data = 1000 * LastY / pop)
dataset <- pib %>%
select(Date, data) %>%
filter(Date >= nd) %>%
drop_na()
l <- dataset[nrow(dataset), ]
ggplot(dataset, aes(x = Date, y = data)) +
geom_line(color = col) +
geom_text(
data = l,
size = 3,
aes(label = paste(
x = prettyNum(data, big.mark = " "),
"€\n", format(Date, "%b-%Y")
))
) +
labs(
title = "GDP per capita of Spain",
subtitle = "€",
caption = "Source: BdE"
) +
scale_y_continuous(labels = scales::label_number()) +
scale_x_date(
date_labels = "%b-%Y",
breaks = br
) +
theme_tidybde()
```

## Unemployment Rate

```{r echo=FALSE}
Expand Down Expand Up @@ -230,36 +187,3 @@ ggplot(dataset, aes(x = Date, y = data)) +
) +
theme_tidybde()
```

## Population

```{r echo=FALSE}
dataset <- bde_ind_population(series_label = "data") %>%
filter(Date >= nd) %>%
drop_na()
l <- dataset[nrow(dataset), ]
ggplot(dataset, aes(x = Date, y = data)) +
geom_line(color = col) +
geom_text(
data = l,
size = 3,
aes(label = paste(
x = prettyNum(data, big.mark = " "),
"\n", format(Date, "%b-%Y")
))
) +
labs(
title = "Population of Spain",
subtitle = "thousands",
caption = "Source: BdE"
) +
scale_x_date(
date_labels = "%b-%Y",
breaks = br
) +
scale_y_continuous(labels = scales::label_number()) +
theme_tidybde()
```
Binary file modified vignettes/chart-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/macroseries-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dbebb4a

Please sign in to comment.