Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table A3.2 not fully loading #34

Open
MattCowgill opened this issue May 16, 2022 · 9 comments
Open

Table A3.2 not fully loading #34

MattCowgill opened this issue May 16, 2022 · 9 comments
Assignees

Comments

@MattCowgill
Copy link
Owner

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

@MattCowgill
Copy link
Owner Author

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

# These are the series IDs in the A3.2 spreadsheet
rba_series <- c(
  "RBASLI",
  "RBASLISIN",
  "RBASLCR",
  "RBASLMD",
  "RBASLFV",
  "RBASLT",
  "RBASWI",
  "RBASWISIN",
  "RBASWCR",
  "RBASWMD",
  "RBASWFV"
)

# These are the series IDs in the spreadsheet that are not in our tibble
rba_series[!rba_series %in% unique(a3_2$series_id)]
#> [1] "RBASLI"    "RBASLISIN" "RBASWI"    "RBASWISIN"

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

@MattCowgill
Copy link
Owner Author

The problem is that several series in table A3.2 are non-numeric. read_rba() coerces value columns to numeric, and drops any that are NA.

@MattCowgill
Copy link
Owner Author

I think the conceptual problem is that this data is already 'tidy', unlike other RBA sheets. Each row is an observation, each column a variable.

@cromj006
Copy link

Thanks for taking a look Matt.

I've just discovered the same issue appears for several series in Stat Table A3 as well (e.g. for "OMO outright transaction detail" and "Bond Purchase Program"). The problem looks to be the same as the issue for A3.2 - the data is already tidied.

Sorry if you've already noticed this too.

@MattCowgill
Copy link
Owner Author

Thanks @cromj006! I wasn't aware of that - thanks for letting me know.

I'm torn between three options here:

  1. read_rba("a3.2") returns an error, saying that table cannot be imported
  2. read_rba("a3.2") returns a table that looks like the one you can open from the RBA website, with separate columns for Bond Issuer, Identifier, Coupon Rate etc
  3. read_rba("a3.2") returns a table with the same columns as any other table you load using read_rba(), with the various bits of metadata (bond issuer, identifier, coupon rate, etc.) pasted together into the series column

@cromj006
Copy link

@MattCowgill option 2 sounds good to me, but I of course don't know if there would be consequences of this more broadly. Option 3 sounds like it could work too if you were somehow able to add the separate_series function from read_abs?

@MattCowgill
Copy link
Owner Author

thanks @cromj006. I am drawn to option 2 as well. My hesitation is just that it would return quite a different-looking tibble for A3.2 (etc) than for other RBA tables. I like the fact that read_rba() returns a tidy tibble with consistent column names, regardless of what the underlying table looks like

@MattCowgill
Copy link
Owner Author

After thinking about this some more, I don't like option (2) because it would return an object different to the one you usually get when you call read_rba(). So that leaves options (1) and (3)

MattCowgill added a commit that referenced this issue May 31, 2022
… != the number of columns (except the first col) in the raw Excel file - see #34
@MattCowgill MattCowgill self-assigned this May 31, 2022
@MattCowgill
Copy link
Owner Author

Tables that appear to have an issue in which the number of unique series IDs in the tibble returned by read_rba() does not equal the number of columns in the Excel sheets:

  • A3
  • A3.1
  • A3.2
  • B12.1.1
  • B12.2.1
  • B13.1.1
  • B13.1.2
  • B13.2.1
  • D14.1
  • F7
  • F8
  • F11.1
  • H3
  • H5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants