Coder Social home page Coder Social logo

readrba's Introduction

readrba

R build status Lifecycle: maturing Codecov test coverage CRAN status

Get data from the Reserve Bank of Australia in a tidy tibble!

Installation

Install from CRAN using:

install.packages("readrba")

Or install the development version from GitHub:

remotes::install_github("mattcowgill/readrba")

Examples

library(ggplot2)
library(dplyr)
library(readrba)

Quick examples

With just a few lines of code, you can get a data series from the RBA and visualise it!

Here’s the unemployment rate:

unemp_rate <- read_rba(series_id = "GLFSURSA") 

unemp_rate %>%
  ggplot(aes(x = date, y = value)) +
  geom_line() +
  theme_minimal() +
  labs(title = "Unemployment rate (actual)")

And you can also easily get the RBA’s public forecasts - from 1990 to present - and visualise those. Here’s every public forecast of the unemployment rate the RBA has made over the past three decades:

unemp_forecasts <- rba_forecasts() %>%
  filter(series == "unemp_rate")

unemp_forecasts %>%
  ggplot(aes(x = date, 
             y = value, 
             group = forecast_date, 
             col = forecast_date)) +
  geom_line() +
  theme_minimal() +
  labs(title = "Unemployment rate (RBA forecasts)")

Reading RBA data

There primary function in {readrba} is read_rba().

Here’s how you fetch the current version of a single RBA statistical table: table G1, consumer price inflation using read_rba():

cpi_table <- read_rba(table_no = "g1")

The object returned by read_rba() is a tidy tibble (ie. in ‘long’ format):

head(cpi_table)
#> # A tibble: 6 × 11
#>   date       series          value frequency series_type units source pub_date  
#>   <date>     <chr>           <dbl> <chr>     <chr>       <chr> <chr>  <date>    
#> 1 1922-06-30 Consumer price…   2.8 Quarterly Original    Inde… ABS /… 2024-08-01
#> 2 1922-09-30 Consumer price…   2.8 Quarterly Original    Inde… ABS /… 2024-08-01
#> 3 1922-12-31 Consumer price…   2.7 Quarterly Original    Inde… ABS /… 2024-08-01
#> 4 1923-03-31 Consumer price…   2.7 Quarterly Original    Inde… ABS /… 2024-08-01
#> 5 1923-06-30 Consumer price…   2.8 Quarterly Original    Inde… ABS /… 2024-08-01
#> 6 1923-09-30 Consumer price…   2.9 Quarterly Original    Inde… ABS /… 2024-08-01
#> # ℹ 3 more variables: series_id <chr>, description <chr>, table_title <chr>

You can also request multiple tables. They’ll be returned together as one tidy tibble:

rba_data <- read_rba(table_no = c("a1", "g1"))

head(rba_data)
#> # A tibble: 6 × 11
#>   date       series          value frequency series_type units source pub_date  
#>   <date>     <chr>           <dbl> <chr>     <chr>       <chr> <chr>  <date>    
#> 1 2013-07-03 Australian dol… 37899 Weekly    Original    $ mi… RBA    2024-08-16
#> 2 2013-07-10 Australian dol… 35106 Weekly    Original    $ mi… RBA    2024-08-16
#> 3 2013-07-17 Australian dol… 32090 Weekly    Original    $ mi… RBA    2024-08-16
#> 4 2013-07-24 Australian dol… 39592 Weekly    Original    $ mi… RBA    2024-08-16
#> 5 2013-07-31 Australian dol… 41286 Weekly    Original    $ mi… RBA    2024-08-16
#> 6 2013-08-07 Australian dol… 37974 Weekly    Original    $ mi… RBA    2024-08-16
#> # ℹ 3 more variables: series_id <chr>, description <chr>, table_title <chr>
unique(rba_data$table_title)
#> [1] "A1 Reserve Bank Of Australia - Balance Sheet"
#> [2] "G1 Consumer Price Inflation"

You can also retrieve data based on the unique RBA time series identifier(s). For example, to getch the consumer price index series only:

cpi_series <- read_rba(series_id = "GCPIAG")
head(cpi_series)
#> # A tibble: 6 × 11
#>   date       series          value frequency series_type units source pub_date  
#>   <date>     <chr>           <dbl> <chr>     <chr>       <chr> <chr>  <date>    
#> 1 1922-06-30 Consumer price…   2.8 Quarterly Original    Inde… ABS /… 2024-08-01
#> 2 1922-09-30 Consumer price…   2.8 Quarterly Original    Inde… ABS /… 2024-08-01
#> 3 1922-12-31 Consumer price…   2.7 Quarterly Original    Inde… ABS /… 2024-08-01
#> 4 1923-03-31 Consumer price…   2.7 Quarterly Original    Inde… ABS /… 2024-08-01
#> 5 1923-06-30 Consumer price…   2.8 Quarterly Original    Inde… ABS /… 2024-08-01
#> 6 1923-09-30 Consumer price…   2.9 Quarterly Original    Inde… ABS /… 2024-08-01
#> # ℹ 3 more variables: series_id <chr>, description <chr>, table_title <chr>
unique(cpi_series$series_id)
#> [1] "GCPIAG"

The convenience function read_rba_seriesid() is a wrapper around read_rba(). This means read_rba_seriesid("GCPIAG") is equivalent to read_rba(series_id = "GCPIAG").

By default, read_rba() fetches the current version of whatever table you request. You can specify the historical version of a table, if it’s available, using the cur_hist argument:

hist_a11 <- read_rba(table_no = "a1.1", cur_hist = "historical")

head(hist_a11)
#> # A tibble: 6 × 11
#>   date       series          value frequency series_type units source pub_date  
#>   <date>     <chr>           <dbl> <chr>     <chr>       <chr> <chr>  <date>    
#> 1 1994-06-01 Australian dol… 13680 Weekly    Original    $ mi… RBA    2023-05-05
#> 2 1994-06-08 Australian dol… 13055 Weekly    Original    $ mi… RBA    2023-05-05
#> 3 1994-06-15 Australian dol… 13086 Weekly    Original    $ mi… RBA    2023-05-05
#> 4 1994-06-22 Australian dol… 12802 Weekly    Original    $ mi… RBA    2023-05-05
#> 5 1994-06-29 Australian dol… 13563 Weekly    Original    $ mi… RBA    2023-05-05
#> 6 1994-07-06 Australian dol… 12179 Weekly    Original    $ mi… RBA    2023-05-05
#> # ℹ 3 more variables: series_id <chr>, description <chr>, table_title <chr>

Browsing RBA data

Two functions are provided to help you find the table number or series ID you need. These are browse_rba_tables() and browse_rba_series(). Each returns a tibble with information about the available RBA data.

browse_rba_tables()
#> # A tibble: 127 × 5
#>    title                              no    url   current_or_historical readable
#>    <chr>                              <chr> <chr> <chr>                 <lgl>   
#>  1 RBA Balance Sheet                  A1    http… current               TRUE    
#>  2 Monetary Policy Changes            A2    http… current               TRUE    
#>  3 Monetary Policy Operations – Curr… A3    http… current               TRUE    
#>  4 Holdings of Australian Government… A3.1  http… current               TRUE    
#>  5 Securities Lending Repurchase and… A3.2  http… current               TRUE    
#>  6 Foreign Exchange Transactions and… A4    http… current               TRUE    
#>  7 Daily Foreign Exchange Market Int… A5    http… current               TRUE    
#>  8 Banknotes on Issue by Denomination A6    http… current               TRUE    
#>  9 Detected Australian Counterfeits … A7    http… current               TRUE    
#> 10 Assets of Financial Institutions   B1    http… current               TRUE    
#> # ℹ 117 more rows
browse_rba_series()
#> # A tibble: 4,369 × 8
#>    table_no series        series_id series_type table_title cur_hist description
#>    <chr>    <chr>         <chr>     <chr>       <chr>       <chr>    <chr>      
#>  1 A1       Australian G… ARBALDOG… Original    A1 Reserve… current  Australian…
#>  2 A1       Australian d… ARBAAASTW Original    A1 Reserve… current  Australian…
#>  3 A1       Australian d… ARBAAASTW Original    A1 Reserve… histori… Australian…
#>  4 A1       Capital and … ARBALCRFW Original    A1 Reserve… current  Capital an…
#>  5 A1       Capital and … ARBALCRFW Original    A1 Reserve… histori… Capital an…
#>  6 A1       Deposits (ex… ARBALDEPW Original    A1 Reserve… histori… Deposits (…
#>  7 A1       Deposits of … ARBALDOO… Original    A1 Reserve… current  Deposits o…
#>  8 A1       Exchange set… ARBALESBW Original    A1 Reserve… current  Exchange s…
#>  9 A1       Exchange set… ARBALESBW Original    A1 Reserve… histori… Exchange s…
#> 10 A1       Gold and for… ARBAAGFXW Original    A1 Reserve… current  Gold and f…
#> # ℹ 4,359 more rows
#> # ℹ 1 more variable: frequency <chr>

You can specify a search string to filter the tables or series, as in:

browse_rba_tables("inflation")
#> # A tibble: 3 × 5
#>   title                               no    url   current_or_historical readable
#>   <chr>                               <chr> <chr> <chr>                 <lgl>   
#> 1 Consumer Price Inflation            G1    http… current               TRUE    
#> 2 Consumer Price Inflation – Expendi… G2    http… current               TRUE    
#> 3 Inflation Expectations              G3    http… current               TRUE

RBA forecasts

The function rba_forecasts() provides easy access to all the RBA’s public forecasts of key economic variables since 1990. The function scrapes the RBA website to obtain the latest Statement on Monetary Policy forecasts.

rba_forecasts()
#> # A tibble: 7,070 × 8
#>    series_desc       forecast_date notes source value date       year_qtr series
#>    <chr>             <date>        <chr> <chr>  <dbl> <date>        <dbl> <chr> 
#>  1 CPI - 4 quarter … 1990-03-01    <NA>  JEFG     8.6 1990-03-01    1990. cpi_a…
#>  2 CPI - 4 quarter … 1990-03-01    <NA>  JEFG     7.6 1990-06-01    1990. cpi_a…
#>  3 CPI - 4 quarter … 1990-03-01    <NA>  JEFG     6.5 1990-09-01    1990. cpi_a…
#>  4 CPI - 4 quarter … 1990-03-01    <NA>  JEFG     6   1990-12-01    1990. cpi_a…
#>  5 CPI - 4 quarter … 1990-03-01    <NA>  JEFG     5.9 1991-03-01    1991. cpi_a…
#>  6 CPI - 4 quarter … 1990-03-01    <NA>  JEFG     6.2 1991-06-01    1991. cpi_a…
#>  7 Unemployment rate 1990-03-01    <NA>  JEFG     5.9 1989-12-01    1989. unemp…
#>  8 Unemployment rate 1990-03-01    <NA>  JEFG     6.3 1990-03-01    1990. unemp…
#>  9 Unemployment rate 1990-03-01    <NA>  JEFG     6.5 1990-06-01    1990. unemp…
#> 10 Unemployment rate 1990-03-01    <NA>  JEFG     6.7 1990-09-01    1990. unemp…
#> # ℹ 7,060 more rows

If you just want the latest forecasts, you can request them:

rba_forecasts(all_or_latest = "latest")
#> # A tibble: 148 × 8
#>    forecast_date date       series       value series_desc source notes year_qtr
#>    <date>        <date>     <chr>        <dbl> <chr>       <chr>  <chr>    <dbl>
#>  1 2024-08-01    2024-06-01 aena_change    6.6 Nominal (n… ABS (… Year…    2024.
#>  2 2024-08-01    2024-12-01 aena_change    3.8 Nominal (n… ABS (… Year…    2024.
#>  3 2024-08-01    2025-06-01 aena_change    4.3 Nominal (n… ABS (… Year…    2025.
#>  4 2024-08-01    2025-12-01 aena_change    4.1 Nominal (n… ABS (… Year…    2025.
#>  5 2024-08-01    2026-06-01 aena_change    4.1 Nominal (n… ABS (… Year…    2026.
#>  6 2024-08-01    2026-12-01 aena_change    3.6 Nominal (n… ABS (… Year…    2026.
#>  7 2024-08-01    2024-06-01 business_in…   1.4 Business i… ABS (… Year…    2024.
#>  8 2024-08-01    2024-12-01 business_in…   0.1 Business i… ABS (… Year…    2024.
#>  9 2024-08-01    2025-06-01 business_in…   2.2 Business i… ABS (… Year…    2025.
#> 10 2024-08-01    2025-12-01 business_in…   2.7 Business i… ABS (… Year…    2025.
#> # ℹ 138 more rows

Data availability

The read_rba() function is able to import most tables on the Statistical Tables page of the RBA website. These are the tables that are downloaded when you use read_rba(cur_hist = "current"), the default.

read_rba() can also download many of the tables on the Historical Data page of the RBA website. To get these, specify cur_hist = "historical" in read_rba().

Historical exchange rate tables

The historical exchange rate tables do not have table numbers on the RBA website. They can still be downloaded, using the following table numbers:

Table title table_no
Exchange Rates – Daily – 1983 to 1986 ex_daily_8386
Exchange Rates – Daily – 1987 to 1990 ex_daily_8790
Exchange Rates – Daily – 1991 to 1994 ex_daily_9194
Exchange Rates – Daily – 1995 to 1998 ex_daily_9598
Exchange Rates – Daily – 1999 to 2002 ex_daily_9902
Exchange Rates – Daily – 2003 to 2006 ex_daily_0306
Exchange Rates – Daily – 2007 to 2009 ex_daily_0709
Exchange Rates – Daily – 2010 to 2013 ex_daily_1013
Exchange Rates – Daily – 2014 to 2017 ex_daily_1417
Exchange Rates – Daily – 2018 to 2022 ex_daily_1822
Exchange Rates – Daily – 2023 to Current ex_daily_23cur
Exchange Rates – Monthly – January 2010 to latest complete month of current year ex_monthly_10cur
Exchange Rates – Monthly – July 1969 to December 2009 ex_monthly_6909

Non-standard tables

read_rba() is currently only able to import RBA statistical tables that are formatted in a (more or less) standard way. Some are formatted in a non-standard way, either because they’re distributions rather than time series, or because they’re particularly old.

Tables that are not able to be downloaded are:

Table title table_no current_or_historical
Household Balance Sheets – Distribution E3 current
Household Gearing – Distribution E4 current
Household Financial Assets – Distribution E5 current
Household Non-Financial Assets – Distribution E6 current
Household Debt – Distribution E7 current
Open Market Operations – 2012 to 2013 A3 historical
Open Market Operations – 2009 to 2011 A3 historical
Open Market Operations – 2003 to 2008 A3 historical
Individual Banks’ Assets – 1991–1992 to 1997–1998 J1 historical
Individual Banks’ Liabilities – 1991–1992 to 1997–1998 J2 historical
Treasury Note Tenders - 1989–2006 E4 historical
Treasury Bond Tenders – 1982–2006 E5 historical
Treasury Bond Tenders – Amount Allotted, by Years to Maturity – 1982–2006 E5 historical
Treasury Bond Switch Tenders – 2008 E6 historical
Treasury Capital Indexed Bonds – 1985–2006 E7 historical
Indicative Mid Rates of Australian Government Securities – 1992 to 2008 F16 historical
Indicative Mid Rates of Australian Government Securities – 2009 to 2013 F16 historical
Zero-coupon Interest Rates – Analytical Series – 1992 to 2008 F17 historical

Resolving network issues by manually setting the download method

Certain corporate networks restrict your ability to download files in an R session. On some of these networks, the "wininet" method must be used when downloading files. Users can specify the method that will be used to download files by setting the "R_READRBA_DL_METHOD" environment variable.

For example, the following code sets the environment variable for your current session:

Sys.setenv("R_READRBA_DL_METHOD" = "wininet")

You can add "R_READRBA_DL_METHOD" to your .Rprofile to have this persist across sessions.

If you have other issues using {readrba} in your corporate environment, I would appreciate you opening an issue on GitHub.

Issues and contributions

I welcome any feature requests or bug reports. The best way is to file a GitHub issue.

I would welcome contributions to the package. Please start by filing an issue, outlining the bug you intend to fix or functionality you intend to add or modify.

Disclaimer

This package is not affiliated with or endorsed by the Reserve Bank of Australia. All data is provided subject to any conditions and restrictions set out on the RBA website.

readrba's People

Contributors

mattcowgill avatar angusmoore avatar benjackman avatar

Stargazers

Mashaal Ahmed avatar The Macro Bootlegger avatar Nik Dawson avatar EconMaett avatar @lpha avatar Anthony avatar  avatar  avatar Johann de Boer avatar  avatar Timothy McCarthy avatar  avatar  avatar  avatar Nicholas Erskine avatar Ian avatar  avatar  avatar Will Mackey avatar Anthony Piccolo avatar Josh Martin avatar  avatar Adam H. Sparks avatar Jamie Hall avatar mikefc avatar Miles McBain avatar Zoe Meers avatar

Watchers

 avatar David Tsang avatar  avatar

readrba's Issues

RBA formats changed to .xlsx (but filenames remain .xls)

The RBA's April updates of at least some stats tables have changed the format to an xlsx but the filename is still ends in .xls. You can verify this by opening the files manually in excel and then re-saving.

Replicate the issue:
read_rba(table_no = c('d1', 'd2'))

Error:
libxls error: Unable to open file

I don't consider this necessarily an issue with readrba (so feel free to delete) but thought it useful to have a central location to discuss the error. Hopefully the RBA fixes this next week.

Historical data cannot be read

> rba_data <- readrba::read_rba(table_no=c("a1", "g1"), cur_hist="historical")
 Error in curl::curl_fetch_memory(url, handle = handle) : 
  Could not resolve host: NA 
13. curl::curl_fetch_memory(url, handle = handle) 
12. request_fetch.write_memory(req$output, req$url, handle) 
11. request_fetch(req$output, req$url, handle) 
10. request_perform(req, hu$handle$handle) 
9. HEAD(x, ...) 
8. http_error(HEAD(x, ...)) 
7. http_error.character(.x) 
6. httr::http_error(.x) 
5. .f(.x[[i]], ...) 
4. purrr::map_lgl(urls, ~!httr::http_error(.x)) 
3. url_exists(urls) 
2. get_rba_urls(table_no = table_no, cur_hist = cur_hist) 
1. readrba::read_rba(table_no = c("a1", "g1"), cur_hist = "historical") 

I spot-checked a few table numbers and this seems to happen for each one.

Could there be an option for current+historical rather than current/historical?

I hacked together my own code to pull a few tables recently, and found that I'd usually need both the "current" and "historical" versions, rbind'ed together. I think the RBA's distinction between the two is mostly about their own internal data-management workflows.

So, a feature request/suggestion — could the cur_hist option default to both?

Long-term bond yields download with missing observations

Hi @MattCowgill

Thank you so much for developing and maintaining this package (and others). I use it extensively for my research and teaching all my subjects at the unimelb and we're integrating your functions in reproducible pipelines for macro data analyses. The package is such a great asset!

I noticed the following problem a month ago. Long-term bond yields download with missing observations.

Here is an illustrative example:

> dwnld  = readrba::read_rba(series_id = "FCMYGBAG10D")
trying URL 'https://www.rba.gov.au/statistics/tables/xls/f02d.xls'
Content type 'application/octet-stream' length 315392 bytes (308 KB)
==================================================
downloaded 308 KB

trying URL 'https://www.rba.gov.au/statistics/tables/xls-hist/f02dhist.xls'
Content type 'application/octet-stream' length 598016 bytes (584 KB)
==================================================
downloaded 584 KB

trying URL 'https://www.rba.gov.au/statistics/tables/xls-hist/f02histhist.xls'
Content type 'application/octet-stream' length 115200 bytes (112 KB)
==================================================
downloaded 112 KB

> tmp    = xts::xts(dwnld$value, dwnld$date)                               
> tmp["2013-05-10/2021-01-10"]
            [,1]
2013-05-10 3.235
2013-05-13 3.245
2013-05-14 3.240
2013-05-15 3.270
2013-05-16 3.240
2013-05-17 3.170
2021-01-04 0.980
2021-01-05 0.950
2021-01-06 1.030
2021-01-07 1.050
2021-01-08 1.090

So, the downloaded daily series does not contain any observations from mid-May 2013 to December 2020.

A similar gap occurs in the monthly series:

> dwnld  = readrba::read_rba(series_id = "FCMYGBAG10")
trying URL 'https://www.rba.gov.au/statistics/tables/xls-hist/f02dhist.xls'
Content type 'application/octet-stream' length 598016 bytes (584 KB)
==================================================
downloaded 584 KB

trying URL 'https://www.rba.gov.au/statistics/tables/xls-hist/f02histhist.xls'
Content type 'application/octet-stream' length 115200 bytes (112 KB)
==================================================
downloaded 112 KB

trying URL 'https://www.rba.gov.au/statistics/tables/xls/f02hist.xls'
Content type 'application/octet-stream' length 30720 bytes (30 KB)
==================================================
downloaded 30 KB

> tmp    = xts::xts(dwnld$value, dwnld$date)                               
> tmp["2013-05/2021-01"]
               [,1]
2013-05-31 3.225000
2021-01-31 1.053684

So, I guess the RBA might have changed the file structure.

I'm sorry for not submitting a pull request with a fix and just reporting the issue. That's what time allows me to do now.

Best Regards, T

Table F2 cannot be read

> bonds <- readrba::read_rba(table_no="f2", cur_hist="current")

trying URL 'https://rba.gov.au/statistics/tables/xls/f02d.xls'
Content type 'application/octet-stream' length 488960 bytes (477 KB)
==================================================
downloaded 477 KB

 Error: Problem with `mutate()` input `pub_date`.
x Input `pub_date` can't be recycled to size 1877.
ℹ Input `pub_date` is `.data$value[.data$title == "Publication date"]`.
ℹ Input `pub_date` must be size 1877 or 1, not 0.
ℹ The error occurred in group 1: series = "Australian Government 10 year bond".
Run `rlang::last_error()` to see where the error occurred. 

inconsistent metadata row ordering in some tables causes failure

Most tables have 11 rows of metadata; the data commences on row 12.
Some, eg. D3, have 12 rows of metadata, with data commencing on row 13.

readrba::read_rba("d3")
#> Error: Problem with `mutate()` input `description`.
#> x Input `description` can't be recycled to size 2964.
#> ℹ Input `description` is `.data$value[.data$title == "Description"]`.
#> ℹ Input `description` must be size 2964 or 1, not 4.
#> ℹ The error occurred in group 1: series = "Adjusted in transfer file script___44104".

Created on 2020-10-09 by the reprex package (v0.3.0)

Table A3.2 not fully loading

This should result in 11 unique series, not 7:

a3_2 <- readrba::read_rba("A3.2") 

length(unique(a3_2$series_id))
#> [1] 7

Created on 2022-05-16 by the reprex package (v2.0.1)

Thanks to Matt Crocker for reporting this issue via email

Excel sheet(s) imported with blank (`NA`) columns

Currently affecting table C2.2

read_rba("C2.2") throws an error. This is because read_excel() is importing several blank columns as NAs, which causes problems when attempting to pivot_longer().

Improve documentation

  • Improve README

  • Vignette

  • Expanded examples

  • Explain which tables work and which don't in README

  • Explain which tables work and which don't in ?read_rba()

Add forecasts

Scrape recent forecasts
Import old forecasts from Bishop & Tulip

Read RBA Importing Issue

Good Morning,

The following code will not important data

read_rba(series_id = "ARBAMPCCCR")

Error is:
Error in safely_read_html(url = table_url) :
Could not read HTML at https://www.rba.gov.au/statistics/tables/

I am not sure what the course of this is, but the read.abs package works fine for me. Thank you in advance for your time

Tables with duplicated column names failing

eg.

readrba::read_rba("c1.3")
#> Error: Names must be unique.
#> x These names are duplicated:
#>   * "Mastercard and Visa share of number of purchases" at locations 2 and 6.
#>   * "Mastercard and Visa share of value of purchases" at locations 3 and 7.
#>   * "American Express and Diners Club share of number of purchases" at locations 4 and 8.
#>   * "American Express and Diners Club share of value of purchases" at locations 5 and 9.

Created on 2020-10-09 by the reprex package (v0.3.0)

Enable tidying of non-standard tables

Requires bespoke code for each table. Consolidate code where possible in common functions.

  • A5 current
  • E3 current
  • E4 current
  • E5 current
  • E6 current
  • E7 current
  • A3 historical
  • F2 historical
  • F16 historical
  • J1 historical
  • J2 historical
  • E4 historical
  • E5 historical
  • E6 historical
  • E7 historical
  • F17 historical

Enable browsing of available tables + series

Current thinking:

Create two functions: browse_rba_tables() and browse_rba_series() that will View() the relevant data object. Each will take a search string as input, and filter only to tables/series containing the string.

New table F16 and changes to existing tables

Hi Matt - thanks very much for maintaining this excellent resource.

As of 29 Dec (see here) we've re-published stats table F16, and made some changes to F2, F2.1, and F17 (which use F16 as a source).

I've tested and all four of these new/updated tables work with readrba after the environment variable table_list is updated. I would do a PR, but I'm not sure how you would be able to verify that the sysdata.rda file is changed appropriately since it's a binary file. Let me know if you're happy for me to do so anyway.

The new F16 may have a bit of a beta test feel to it, and we're working to improve it over time. But feedback welcome of course.

Cheers and happy new year
Ben Jackman

Disconnect between file format and file extension

Occasionally RBA Excel files are released with a mismatch between the file extension and the actual file format. For example:

url <- readrba:::get_rba_urls("d1")
filename <- readrba:::download_rba(url)

# The file extension is xls
readxl::format_from_ext(filename)
#> [1] "xls"

# But it appears to be an xlsx file internally
readxl::format_from_signature(filename)
#> [1] "xlsx"

# This fails:
readxl::read_xls(filename)
#> Error: 
#>   filepath: /private/var/folders/4v/f518hjbj00b64c7j75n4k_jc0000gq/T/RtmpkOD746/d01hist.xls
#>   libxls error: Unable to open file

# This works:
readxl::read_xlsx(filename)
#> New names:
#> • `` -> `...2`
#> • `` -> `...3`
#> • `` -> `...4`
#> • `` -> `...5`
#> • `` -> `...6`
#> • `` -> `...7`
#> • `` -> `...8`
#> • `` -> `...9`
#> • `` -> `...10`
#> • `` -> `...11`
#> • `` -> `...12`
#> • `` -> `...13`
#> • `` -> `...14`
#> • `` -> `...15`
#> • `` -> `...16`
#> • `` -> `...17`
#> # A tibble: 558 × 17
#>    `D1 GROWTH IN S…` ...2  ...3  ...4  ...5  ...6  ...7  ...8  ...9  ...10 ...11
#>    <chr>             <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#>  1 Title             Cred… Cred… Cred… Cred… Cred… Cred… Cred… Cred… Cred… Cred…
#>  2 Description       Cred… Cred… Cred… Cred… Cred… Cred… Cred… Cred… Cred… Cred…
#>  3 Frequency         Mont… Mont… Mont… Mont… Mont… Mont… Mont… Mont… Mont… Mont…
#>  4 Type              Seas… Seas… Seas… Seas… Seas… Seas… Seas… Seas… Seas… Seas…
#>  5 Units             Per … Per … Per … Per … Per … Per … Per … Per … Per … Per …
#>  6 <NA>              <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA> 
#>  7 <NA>              <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA> 
#>  8 Source            RBA   RBA   RBA   RBA   RBA   RBA   RBA   RBA   RBA   RBA  
#>  9 Publication date  44712 44712 44712 44712 44712 44712 44712 44712 44712 44712
#> 10 Series ID         DGFA… DGFA… DGFA… DGFA… DGFA… DGFA… DGFA… DGFA… DGFA… DGFA…
#> # … with 548 more rows, and 6 more variables: ...12 <chr>, ...13 <chr>,
#> #   ...14 <chr>, ...15 <chr>, ...16 <chr>, ...17 <chr>

Created on 2022-05-31 by the reprex package (v2.0.1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.