| Title: | Download Data from the Reserve Bank of New Zealand Website |
| Version: | 3.0.0 |
| Description: | Provides a convenient way of accessing data published by the Reserve Bank of New Zealand (RBNZ) on their website, https://www.rbnz.govt.nz/statistics. A range of financial and economic data is provided in spreadsheet format including exchange and interest rates, commercial lending statistics, Reserve Bank market operations, financial institution statistics, household financial data, New Zealand debt security information, and economic indicators. This package provides a method to download those spreadsheets and read them directly into R. |
| Depends: | R (≥ 3.5.0) |
| Imports: | httr, lubridate, readxl, rvest, xml2 |
| Suggests: | knitr, rmarkdown |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| VignetteBuilder: | knitr |
| BugReports: | https://github.com/rntq472/RBNZ/issues |
| Language: | en-GB |
| NeedsCompilation: | no |
| Packaged: | 2025-10-28 12:55:36 UTC; jasper |
| Author: | Jasper Watson [aut, cre] |
| Maintainer: | Jasper Watson <jasper.g.watson@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2025-10-28 13:30:02 UTC |
Access Data from the Reserve Bank of New Zealand Website
Description
Provides a convenient way of accessing data published by the Reserve Bank of New Zealand (RBNZ) on their website, <https://www.rbnz.govt.nz/statistics>. A range of financial and economic data is provided in spreadsheet format including exchange and interest rates, commercial lending statistics, Reserve Bank market operations, financial institution statistics, household financial data, New Zealand debt security information, and economic indicators. This package provides a method to download those spreadsheets and read them directly into R.
Details
The copyright notice for this data can be found at https://www.rbnz.govt.nz/about-our-site/terms-of-use.
Author(s)
Jasper Watson
See Also
Useful links:
Report bugs at https://github.com/rntq472/RBNZ/issues
Exchange Rates and TWI
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/exchange-rates-and-the-trade-weighted-index for a full description.
Arguments
option |
Allowed values are “daily” (default) and “monthly”. |
Note
The historical data is split across multiple files at source. We download all of them and merge together to form a complete history.
TWI Weights
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/trade-weighted-index-weights-and-trade-volumes for a full description.
Historical TWI Weights
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/trade-weighted-index-historical-weights for a full description.
Note
The historical data is split across multiple files at source. We download all of them and merge together into a single data frame, but note that unlike with most of the other series available here it is not a simple matter of rbind-ing all the data together. The composition of the TWI changed in December 2014 but there were some components that were present both before and after, for example Australia. These are returned as separate fields in the output rather than combining them into a single entry.
Wholesale Interest Rates
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/wholesale-interest-rates for a full description.
Arguments
option |
Allowed values are “daily” (default), “dailyclose”, “monthly”, and “monthlyclose”. |
Note
The historical data is split across multiple files at source. We download all of them and merge together to form a complete history.
New Residential Mortgage Standard Interest Rates
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/new-residential-mortgage-standard-interest-rates for a full description.
New Residential Mortgage Special Interest Rates
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/new-residential-mortgage-special-interest-rates for a full description.
New Interest Bearing Call Savings Account Interest Rates
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/new-interest-bearing-call-savings-account-interest-rates for a full description.
New Interest Bearing Term Deposit Interest rates
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/new-interest-bearing-term-deposit-interest-rate for a full description.
New Interest Bearing Term PIE Deposits Interest Rates
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/new-interest-bearing-term-portfolio-investment-entity-deposit-interest-rates for a full description.
Retail Interest Rates on Lending and Deposits
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/retail-interest-rates-on-lending-and-deposits for a full description.
New Residential Mortgage Weighted Average Interest Rates
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/new-residential-mortgage-weighted-average-interest-rates for a full description.
Foreign Exchange Turnover
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/foreign-exchange-turnover for a full description.
Arguments
option |
Allowed values are “NZD” (default), “USD” and “EUR”. |
Yields on Loans
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/yields-on-loans for a full description.
Costs of Deposits
Description
See https://www.rbnz.govt.nz/statistics/series/exchange-and-interest-rates/costs-of-deposits for a full description.
Credit Card Balances
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/credit-card-balances for a full description.
Arguments
option |
Allowed values are “monthend” (default) and “dailyaverage”. |
Credit Card Spending
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/credit-card-spending for a full description.
Arguments
option |
Allowed values are “issued” (default) and “used”. |
Key Household Financial Statistics
Description
See https://www.rbnz.govt.nz/statistics/series/households/key-household-financial-statistics for a full description.
Household Balance Sheet
Description
See https://www.rbnz.govt.nz/statistics/series/households/household-balance-sheet for a full description.
New Residential Mortgage Lending by Loan-To-Valuation Ratio
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/new-residential-mortgage-lending-by-loan-to-valuation-ratio for a full description.
New Residential Mortgage Lending by Borrower Type
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/new-residential-mortgage-lending-by-borrower-type for a full description.
New and Existing Residential Mortgage Lending by Payment Type
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/new-and-existing-residential-mortgage-lending-by-payment-type2 for a full description.
New Residential Mortgage Lending By Purpose
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/new-residential-mortgage-lending-by-purpose for a full description.
Residential Mortgage Loan Reconciliation
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/residential-mortgage-loan-reconciliation for a full description.
Residential Mortgage Lending by Debt-To-Income Purpose Use
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/residential-mortgage-lending-by-debt-to-income-dti-purpose-use for a full description.
Residential Mortgage Borrower Gross Income (BGI)
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/residential-mortgage-borrower-gross-income-bgi for a full description.
Sector Lending
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/registered-banks-and-non-bank-lending-institutions-sector-lending for a full description.
Money and Credit Aggregates (Depository Corporations)
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/depository-corporations-money-and-credit-aggregates for a full description.
Arguments
option |
Allowed values are “default” (default) and “longrun”. |
Other Depository Corporations Analytical Accounts
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/other-depository-corporations-analytical-accounts for a full description.
Depository Corporations Analytical Accounts
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/depository-corporations-analytical-accounts for a full description.
Other Financial Corporations Analytical Accounts
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/other-financial-corporations-analytical-accounts for a full description.
Credit Conditions Survey
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/credit-conditions for a full description.
Note
There is a second dataset present (the ec60 file) which is not retrieved as it is in a non-standard format.
Bank Customer Lending Flows
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/bank-customer-lending-flows for a full description.
Bank Customer Lending Stocks
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/bank-customer-lending-stocks for a full description.
New Lending By Purpose
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/new-lending-by-purpose for a full description.
New Lending Fully Secured By Residential Mortgage
Description
See https://www.rbnz.govt.nz/statistics/series/lending-and-monetary/new-lending-fully-secured-by-residential-mortgage for a full description.
Influences on Settlement Cash
Description
See https://www.rbnz.govt.nz/statistics/series/reserve-bank/influences-on-settlement-cash for a full description.
Note
This data is in a non-standard format. The return value is a list containing the fields "C16", which is historical C16 data, and "data", which is the two D10 spreadsheets, historical and current, combined together.
Standing Facilities
Description
See https://www.rbnz.govt.nz/statistics/series/reserve-bank/standing-facilities for a full description.
Note
This data is in a non-standard format.
Open Market Operations
Description
See https://www.rbnz.govt.nz/statistics/series/reserve-bank/open-market-operations for a full description.
Note
This data is in a non-standard format.
Holdings of Central Government Debt Securities
Description
See https://www.rbnz.govt.nz/statistics/series/new-zealand-debt-securities/holdings-of-central-government-debt-securities for a full description.
Non-Resident Holdings of Individual Bonds (Nominal Value)
Description
See https://www.rbnz.govt.nz/statistics/series/new-zealand-debt-securities/non-resident-holdings-of-individual-bonds for a full description.
Holdings of Kauri Bonds (Nominal Value)
Description
See https://www.rbnz.govt.nz/statistics/series/new-zealand-debt-securities/holdings-of-kauri-bonds for a full description.
Government Bond Turnover
Description
See https://www.rbnz.govt.nz/statistics/series/new-zealand-debt-securities/government-bond-turnover for a full description.
Arguments
option |
Allowed values are “daily” (default) and “monthly”. |
Note
The historical archive file is not returned as it is in a different format.
New Zealand's Official Overseas Reserves
Description
See https://www.rbnz.govt.nz/statistics/series/international-position/new-zealands-official-overseas-reserves for a full description.
New Zealand's Position with the IMF
Description
See https://www.rbnz.govt.nz/statistics/series/international-position/new-zealands-position-with-the-international-monetary-fund for a full description.
Bank Notes in the Hands of the Public
Description
See https://www.rbnz.govt.nz/statistics/series/reserve-bank/bank-notes-in-the-hands-of-the-public for a full description.
Note
This data is in a non-standard format.
Coin Mintings
Description
See https://www.rbnz.govt.nz/statistics/series/reserve-bank/coin-mintings for a full description.
Note
This data is in a non-standard format.
Reserve Bank Foreign Currency Assets and Liabilities
Description
See https://www.rbnz.govt.nz/statistics/series/reserve-bank/our-foreign-currency-assets-and-liabilities for a full description.
Note
This data is in a non-standard format.
Household Inflation Expectations
Description
See https://www.rbnz.govt.nz/statistics/series/households/household-inflation-expectations for a full description.
Housing and Employment
Description
See https://www.rbnz.govt.nz/statistics/series/households/housing-and-employment for a full description.
Cash Use
Description
See https://www.rbnz.govt.nz/statistics/series/households/cash-use for a full description.
Insurance: Income Statement
Description
See https://www.rbnz.govt.nz/statistics/series/insurance-financial-statistics/insurance-income-statement for a full description.
Insurance: Balance Sheet
Description
See https://www.rbnz.govt.nz/statistics/series/insurance-financial-statistics/insurance-balance-sheet for a full description.
Mismatch Ratios
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-mismatch-ratios for a full description.
Core Funding Ratio
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-core-funding-ratio for a full description.
Face Value of Funding by Residual Maturity ($m)
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-face-value-of-funding-by-residual-maturity for a full description.
Prices
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/prices for a full description.
Arguments
option |
Allowed values are “default” (default) and “longrun”. |
Housing
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/housing for a full description.
Population and Migration
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/population-and-migration for a full description.
Survey of Expectations
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/population-and-migration for a full description.
Business Expectations Survey
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/business-expectations-survey for a full description.
Consumption
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/consumption for a full description.
Investment
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/investment for a full description.
Domestic Trade
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/domestic-trade for a full description.
Gross Domestic Product
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/gross-domestic-product for a full description.
National Saving (Year Ended March)
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/national-saving for a full description.
Balance of Payments and International Investment Position
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/balance-of-payments-and-international-investment-position for a full description.
Overseas Trade
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/overseas-trade for a full description.
Labour Market
Description
See https://www.rbnz.govt.nz/statistics/series/economic-indicators/labour-market for a full description.
Reserve Bank Balance Sheet
Description
See https://www.rbnz.govt.nz/statistics/series/reserve-bank/our-balance-sheet for a full description.
Reserve Bank Statistical Balance Sheet
Description
See https://www.rbnz.govt.nz/statistics/series/reserve-bank/our-statistical-balance-sheet for a full description.
Reserve Bank Analytical Accounts
Description
See https://www.rbnz.govt.nz/statistics/series/reserve-bank/our-analytical-accounts for a full description.
Banks: Balance Sheet
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-balance-sheet for a full description.
Arguments
option |
Allowed values are “default” (default), “longrun”, and “moredetail”. |
Banks: Summary Income Statement and Related Ratios
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-summary-income-statement-and-related-ratios for a full description.
Banks: Income Statement
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-income-statement for a full description.
Banks: Assets - Loans by Sector
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-assets-loans-by-sector for a full description.
Banks: Assets – Loans by Purpose
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-assets-loans-by-purpose for a full description.
Banks: Assets – Loans by Product
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-assets-loans-by-product for a full description.
Banks: Assets – Loans Fully Secured by Residential Mortgage
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-assets-loans-fully-secured-by-residential-mortgage for a full description.
Arguments
option |
Allowed values are “default” (default) and “longrun”. |
Banks: Assets – Loans and Repos by Industry
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-assets-loans-and-repos-by-industry for a full description.
Banks: Assets – Loans by Business Size
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-assets-loans-by-business-size for a full description.
Banks: Assets – Loans by Product
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-assets-business-loans-by-product for a full description.
Banks: Assets – Agriculture Loans by Product
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-assets-agriculture-loans-by-product for a full description.
Banks: Liabilities – Deposits by Sector
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-liabilities-deposits-by-sector for a full description.
Arguments
option |
Allowed values are “default” (default) and “longrun”. |
Banks: Liabilities – Deposits by Industry
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-liabilities-deposits-by-industry for a full description.
Banks: Assets - Loans by Asset Quality
Description
See https://www.rbnz.govt.nz/statistics/series/registered-banks/banks-assets-loans-by-asset-quality for a full description.
Arguments
option |
Allowed values are “default” (default) and “longrun”. |
New Zealand's International Reserves and Foreign Currency Liquidity
Description
See https://www.rbnz.govt.nz/statistics/series/international-position/new-zealands-international-reserves-and-foreign-currency-liquidity for a full description.
Note
This is a non-standard dataset.
Non Banks: Balance Sheet
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/non-banks-balance-sheet for a full description.
Savings Institutions: Balance Sheet
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/savings-institutions-balance-sheet for a full description.
Deposit Taking Finance Companies: Balance Sheet
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/deposit-taking-finance-companies-balance-sheet for a full description.
Non-Deposit Taking Finance Companies: Balance Sheet
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/non-deposit-taking-finance-companies-balance-sheet for a full description.
Non Banks: Funding and Claims by Sector
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/non-banks-funding-and-claims-by-sector for a full description.
Funds Under Management
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/managed-funds-funds-under-management for a full description.
Managed Fund Assets
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/managed-funds-assets-by-sector for a full description.
Life Insurance
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/life-insurance-assets-by-sector for a full description.
KiwiSaver
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/kiwisaver-assets-by-sector for a full description.
Other Registered Superannuation
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/other-registered-superannuation-funds-assets-by-sector for a full description.
Retail Unit Trusts
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/retail-unit-trusts-assets-by-sector for a full description.
Cash Management Trusts
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/cash-management-trusts-assets-by-sector for a full description.
Wholesale Trusts
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/wholesale-trusts-assets-by-sector for a full description.
Wholesale Trusts and Other Funds
Description
See https://www.rbnz.govt.nz/statistics/series/non-banks-and-other-financial-institutions/wholesale-trusts-and-other-funds-assets-by-product-type for a full description.
List All Data Series Available for Download
Description
List All Data Series Available for Download
Usage
allAvailableSeries()
Value
Character vector of series names.
Author(s)
Jasper Watson
Examples
print(allAvailableSeries())
Determine the URL for a File to be Downloaded
Description
Deprecated - the series pages are no longer used.
Usage
getDownloadLink(subFileName, seriesPage, series)
Arguments
subFileName |
The name of the file to be downloaded, as provided by seriesOptions(). May contain only part of a series. |
seriesPage |
An XML document returned by xml2::read_html containing the webpage pertaining to the desired series. |
series |
Character string giving the name of the data series to retrieve. |
Value
Character string giving the URL of the file to be downloaded.
Author(s)
Jasper Watson
Retrieve Data From the Reserve Bank of New Zealand Website
Description
Retrieves data from https://www.rbnz.govt.nz/statistics for the series specified by the user. This involves downloading one or more spreadsheets and reading them into R.
Usage
getSeries(
series,
option = getDefaultOption(series),
replaceColumnNames = TRUE,
fieldForColumnNames = "Series",
reloadOnlyLatest = TRUE,
cacheOnly = FALSE,
destDir = NULL,
quiet = TRUE,
wait = 60
)
Arguments
series |
Character string giving the name of the data series to retrieve. |
option |
Character string specifying which format of the data series to retrieve, if necessary. For information on the available options see the help file for the particular series name (for example ?B1 will tell you that the B1 series can be downloaded either as daily or monthly data, with the former being the default). This argument is unnecessary for series that only have one data format. |
replaceColumnNames |
Logical indicating whether to change the column names of the output data from the Series ID's used in the source spreadsheets to more informative values based on the information in the metadata. Defaults to TRUE. |
fieldForColumnNames |
If replaceColumnNames is TRUE then this variable specifies which columns of the meta data file will be used to construct the column names. Defaults to “Series” but sometimes you may want to change it to “Group” or c(“Group”, “Series”). “SeriesID” is also allowed. |
reloadOnlyLatest |
Logical indicated whether to skip downloading files containing past data (with a defined endpoint) if they already exist. For example if a series has separate spreadsheets for start-to-2015 and 2015-onwards then we don't need to repeatedly download the former item; only the latter one will be updated. |
cacheOnly |
Logical indicating that the RBNZ website should not be read and the files only loaded from an existing cache on disk. |
destDir |
File path to a directory in which to place the downloaded spreadsheets. If not specified the value of getOption("RBNZ.destDir") will be checked. If that is NULL too then the files will be placed into tempdir() and deleted on exit. |
quiet |
Logical to be passed to utils::download.file. |
wait |
Numeric giving the number of seconds to wait between downloads. Defaults to 60. Note that this applies to reading the series page and to each individual spreadsheet download, so a series with one spreadsheet would have two downloads sixty seconds apart. |
Value
For most series a list containing the fields “meta” and “data” which are data frames containing the metadata and actual data, respectively. There are a few series that do not follow this format, and for these the spreadsheets are just downloaded and read into a list of data frames, one for each sheet, with no organising or cleaning.
Author(s)
Jasper Watson
Examples
## List the available data series.
print(allAvailableSeries())
## Not run:
## Download exchange rate data and plot NZD vs sterling.
b1 <- getSeries('B1')
plot(b1$data$Date, b1$data$UK_pound_sterling, type = 'l')
## Now use monthly data (previous was daily).
b1_monthly <- getSeries('B1', 'monthly')
plot(b1_monthly$data$Date, b1_monthly$data$UK_pound_sterling,
type = 'l')
## End(Not run)
Determine the URL of a Webpage Pertaining to a Series
Description
Deprecated - the series pages are no longer used.
Usage
getSeriesPageURL(series)
Arguments
series |
Character string giving the name of the data series to retrieve. |
Value
Character string giving the URL of the series webpage.
Author(s)
Jasper Watson
Read a Series Webpage Into an XML object
Description
Deprecated - the series pages are no longer used.
Usage
readSeriesPage(series, quiet = TRUE, destDir, deleteFiles, wait = 60)
Arguments
series |
Character string giving the name of the data series to retrieve. |
quiet |
Logical to be passed to utils::download.file. |
destDir |
File path to a directory in which to place the downloaded spreadsheets. If not specified the value of getOption("RBNZ.destDir") will be checked. If that is NULL too then the files will be placed into tempdir() and deleted on exit. |
wait |
Numeric giving the number of seconds to wait between downloads. Defaults to 60. Note that this applies to reading the series page and to each individual spreadsheet download, so a series with one spreadsheet would have two downloads sixty seconds apart. |
Value
An XML document returned by xml2::read_html containing the webpage pertaining to the desired series.
Author(s)
Jasper Watson
Read a Downloaded Spreadsheet
Description
Read a Downloaded Spreadsheet
Usage
readSpreadsheet(
destfile,
series,
subFileName,
fieldForColumnNames,
deleteFiles
)
Arguments
destfile |
File path of the downloaded spreadsheet. |
series |
Character string giving the name of the data series to retrieve. |
subFileName |
Name of the spreadsheet for download according to the source URL. |
fieldForColumnNames |
If replaceColumnNames is TRUE then this variable specifies which columns of the meta data file will be used to construct the column names. Defaults to “Series” but sometimes you may want to change it to “Group” or c(“Group”, “Series”). “SeriesID” is also allowed. |
deleteFiles |
Logical indicating whether to delete the spreadsheet after reading it. |
Value
The contents of the spreadsheet. For most series this will be in the form of a list of two data frames, one called “data” and the other “meta”. For some series (see specialCases()), the data is not in the standard format as the rest and so is just returned directly as the results of read_xlsx for each sheet in the spreadsheet.
Note
Series B13 doesn't have a full date specified, only year or month and year. These values values are returned as the first of the month/year.
Author(s)
Jasper Watson