| boj_data | R Documentation |
boj_data() is the main data function. It accepts one or more BOJ series
codes, splits requests into safe batches of 250 codes, follows
NEXTPOSITION until complete, and returns one observation per row. All codes
in a BOJ code request must have the same frequency.
boj_data(
db,
code,
start_date = NULL,
end_date = NULL,
lang = boj_default("lang", "en"),
wide = FALSE,
wait = boj_default("wait", 1),
timeout = boj_default("timeout", 30),
retries = boj_default("retries", 3)
)
db |
BOJ database identifier, such as |
code |
Character vector of series codes without the database prefix.
For example, use |
start_date, end_date |
Optional BOJ period codes. Accepted request forms
are |
lang |
Response language, |
wide |
If |
wait |
Requested seconds between automatic requests. The default is one second, and values below one are treated as one whenever another request is needed, to avoid high-frequency access prohibited by the BOJ. |
timeout |
Request timeout in seconds. |
retries |
Number of retries for network and transient server errors. |
A named code vector creates convenient aliases, following the style of
WDI::WDI(). The original BOJ code is always retained in series_code.
A tibble. Long output contains db, series, series_code, name,
unit, frequency, category, last_update, time, date, and
value. time preserves the exact BOJ period code. date is the first
day of non-daily periods (April 1 for fiscal years); use time when exact
period semantics matter.
## Not run:
fx <- boj_data(
db = "FM08",
code = c(usd_yen = "FXERM07"),
start_date = "202401",
end_date = "202412"
)
boj_data(
"FM08",
c(usd_yen = "FXERM07", euro_yen = "FXERM09"),
start_date = "202401",
wide = TRUE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.