Title: | Interface to Bank of Japan Statistics |
---|---|
Description: | Provides an interface to Bank of Japan <https://www.boj.or.jp> statistics. |
Authors: | Stefan Angrick [aut, cre, cph] |
Maintainer: | Stefan Angrick <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.3.4 |
Built: | 2025-01-21 13:20:34 UTC |
Source: | CRAN |
Download and parse a BOJ data set
get_boj(item_url, auto_pivot = TRUE, ...)
get_boj(item_url, auto_pivot = TRUE, ...)
item_url |
Character. URL of the data set to be imported (usually
obtained via |
auto_pivot |
Logical. Controls whether source data set is converted to
long format. Set this to |
... |
Arguments passed to |
A tibble data frame, or a list of tibble data frames in cases where the source zip file contains multiple csv files.
ds <- get_boj_datasets() df <- get_boj(ds$url[(ds$name == "sppi_q_en")])
ds <- get_boj_datasets() df <- get_boj(ds$url[(ds$name == "sppi_q_en")])
Retrieve a list of available BOJ data sets
get_boj_datasets( base_url = "https://www.stat-search.boj.or.jp/info/dload_en.html" )
get_boj_datasets( base_url = "https://www.stat-search.boj.or.jp/info/dload_en.html" )
base_url |
Character. URL of the BOJ's Time-Series Data portal flat files page (optional). |
A tibble data frame.
ds <- get_boj_datasets()
ds <- get_boj_datasets()
Convert a BOJ data set to long format
pivot_longer_boj(tbl)
pivot_longer_boj(tbl)
tbl |
Tibble. A tibble data frame containing a BOJ data set (usually
obtained via |
A tibble data frame in long format.
ds <- get_boj_datasets() sppi <- get_boj(ds$url[(ds$name == "sppi_q_en")], auto_pivot = FALSE) sppi <- subset(sppi, code == "PRCS15_52S0000000_CQ") sppi <- pivot_longer_boj(sppi)
ds <- get_boj_datasets() sppi <- get_boj(ds$url[(ds$name == "sppi_q_en")], auto_pivot = FALSE) sppi <- subset(sppi, code == "PRCS15_52S0000000_CQ") sppi <- pivot_longer_boj(sppi)