MattCowgill / readabs

Download and tidy time series data from the Australian Bureau of Statistics in R

Home Page:https://mattcowgill.github.io/readabs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some series IDs in capex release fail

MattCowgill opened this issue · comments

thanks to @MacroDave for reporting.

Longer time series IDs in ABS 5625.0 do not work:

readabs::read_abs(series_id = "A124798760V")
#> Finding filenames for tables corresponding to ABS series ID
#> Error in get_xml_df(url = full_urls[i]): Couldn't find a valid ABS time series in catalogue number

Created on 2021-03-28 by the reprex package (v1.0.0)

Shorter time series IDs work:

readabs::read_abs(series_id = "A3515146V")
#> Finding filenames for tables corresponding to ABS series ID
#> Attempting to download files from series ID , Private New Capital Expenditure and Expected Expenditure, Australia
#> Downloading https://www.abs.gov.au/statistics/economy/business-indicators/private-new-capital-expenditure-and-expected-expenditure-australia/latest-release/04_current_prices_seasonally_adjusted_capex.xls
#> Extracting data from downloaded spreadsheets
#> Tidying data from imported ABS spreadsheets
#> # A tibble: 135 x 12
#>    table_no  sheet_no table_title  date       series value series_type data_type
#>    <chr>     <chr>    <chr>        <date>     <chr>  <dbl> <chr>       <chr>    
#>  1 04_curre… Data1    Table 4. Ac… 1987-06-01 Actua…   255 Seasonally… FLOW     
#>  2 04_curre… Data1    Table 4. Ac… 1987-09-01 Actua…   454 Seasonally… FLOW     
#>  3 04_curre… Data1    Table 4. Ac… 1987-12-01 Actua…   308 Seasonally… FLOW     
#>  4 04_curre… Data1    Table 4. Ac… 1988-03-01 Actua…   370 Seasonally… FLOW     
#>  5 04_curre… Data1    Table 4. Ac… 1988-06-01 Actua…   344 Seasonally… FLOW     
#>  6 04_curre… Data1    Table 4. Ac… 1988-09-01 Actua…   338 Seasonally… FLOW     
#>  7 04_curre… Data1    Table 4. Ac… 1988-12-01 Actua…   434 Seasonally… FLOW     
#>  8 04_curre… Data1    Table 4. Ac… 1989-03-01 Actua…   447 Seasonally… FLOW     
#>  9 04_curre… Data1    Table 4. Ac… 1989-06-01 Actua…   467 Seasonally… FLOW     
#> 10 04_curre… Data1    Table 4. Ac… 1989-09-01 Actua…   428 Seasonally… FLOW     
#> # … with 125 more rows, and 4 more variables: collection_month <chr>,
#> #   frequency <chr>, series_id <chr>, unit <chr>

Created on 2021-03-28 by the reprex package (v1.0.0)

Note that both the above time series IDs are in Table 4 of ABS 5625.0. It's possible to obtain both data series above by requested the table, rather than the series IDs:

capex_t4 <- readabs::read_abs("5625.0", "4")
#> Finding filenames for tables corresponding to ABS catalogue 5625.0
#> Attempting to download files from catalogue 5625.0, Private New Capital Expenditure and Expected Expenditure, Australia
#> Downloading https://www.abs.gov.au/statistics/economy/business-indicators/private-new-capital-expenditure-and-expected-expenditure-australia/latest-release/04_current_prices_seasonally_adjusted_capex.xls
#> Extracting data from downloaded spreadsheets
#> Tidying data from imported ABS spreadsheets

"A124798760V" %in% unique(capex_t4$series_id)
#> [1] TRUE
"A3515146V" %in% unique(capex_t4$series_id)
#> [1] TRUE

Created on 2021-03-28 by the reprex package (v1.0.0)

The problem seems to be in the Time Series Directory. This (valid) TSD request returns an error:
https://ausstats.abs.gov.au/servlet/TSSearchServlet?sid=A124798760V

I contacted the ABS today (2021-03-28) regarding this issue.

Received a response today (2021-03-29) acknowledging the issue and indicating it has been escalated.

Received a response on 2021-03-31 indicating that this issue will be fixed in the coming days

The ABS has now resolved this issue. Thanks @MacroDave for reporting.