The RBNZ package allows users to download data from the Reserve Bank of New Zealand website.
An overview of the package can be found on CRAN or in vignettes/Overview.Rmd.
## Install from CRAN:
install.packages('RBNZ')
## Install the development version from GitHub:
## install.packages("devtools")
devtools::install_github("rntq472/RBNZ")
The main entry point is the getSeries function where users can choose
a data series to retrieve:
library(RBNZ)
m1 <- getSeries('M1')
One option is to email the RBNZ and request that your (static) public IP address be whitelisted. The email to contact is listed here.
The second option is to download the necessary files from the RBNZ website manually through your browser and then use this package to read and organise them. This can be done by downloading the spreadsheets needed and saving them in a given directory without changing their file names. This could be done from the individual series page or from the summary page.
For example for the B1 series a user could download and save the following spreadsheets:
They could then load the data as follows:
library(RBNZ)
dat <- getSeries('B1', destDir = 'path_to_downloaded_files', cacheOnly = TRUE)
If you are always having to do this then you can specify the download
path in your .Rprofile using
options(RBNZ.destDir = "path/to/stored/files").
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.