Type: | Package |
Title: | Provide R Client to the Bank of Canada's Valet API |
Version: | 0.9.1 |
Description: | The Bank of Canada updated their Valet API https://www.bankofcanada.ca/valet/docs, and no R client currently exists. This provides access to all of Valet's endpoints and serves responses in wide format easy for researchers to handle but also provides tools to access API responses as a list. |
License: | MIT + file LICENSE |
URL: | https://github.com/runkelcorey/valet, https://runkelcorey.github.io/valet/ |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Imports: | magrittr, httr, dplyr, readr, purrr, jsonlite |
Suggests: | rmarkdown, knitr, testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2025-05-13 13:52:17 UTC; corey |
Author: | Corey Runkel |
Maintainer: | Corey Runkel <runkelcorey@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-05-13 14:40:03 UTC |
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Arguments
lhs |
A value or the magrittr placeholder. |
rhs |
A function call using the magrittr semantics. |
Value
The result of calling 'rhs(lhs)'.
Get series or series-group details
Description
get_details
returns metadata from a Bank of Canada series or series
group.
Usage
get_details(name = NULL, group = FALSE)
Arguments
name |
A character of length 1 indicating the series or series group for which information should be retrieved. |
group |
A Boolean indicating whether the |
Value
A list of series or group details.
Examples
get_details("CES_C4E_LOSE_JOB_SK")
## Not run:
get_details("BAPF_TRANSACTION_DATA")
## End(Not run)
get_details("BAPF_TRANSACTION_DATA", group = TRUE)
Get series-group observations
Description
get_group
returns observations from a Bank of Canada series group.
Usage
get_group(name = NULL, ...)
Arguments
name |
A |
... |
Additional query parameters. Possible values are |
Details
Valet, the server-side API, does not always return observations filtered by ... arguments for series groups, even if it will accept the request.
Value
A tibble
.
Examples
get_group("BAPF_TRANSACTION_DATA")
get_group("gbpp")
## Not run:
#this is a series
get_group("FXCADAUD")
## End(Not run)
List possible series or groups.
Description
get_list
returns metadata about all Bank of Canada series or series
groups.
Usage
get_list(type = c("series", "groups"))
Arguments
type |
Either |
Value
A tibble
of series or group information.
Get series observations
Description
get_series
returns observations from one or more Bank of Canada
series, subject to some date filtering.
Usage
get_series(name = NULL, ...)
Arguments
name |
A |
... |
Additional query parameters. Possible values are |
Value
A tibble
of size length(name) + 1
.
Examples
get_series("FXCADAUD")
## Not run:
#this is a group
get_series("BAPF")
## End(Not run)
Retrieve Valet response
Description
valet
is the core back-end to get responses from the Bank of Canada
API.
Usage
valet(name = NULL, group = FALSE, ...)
Arguments
name |
A character of at least length 1 indicating the series or series group to retrieve. |
group |
Boolean indicating whether the |
... |
Query parameters from other methods. |
Value
A valet
object.
Examples
valet(name = "GBPP", group = TRUE, recent_weeks = 2)