MattCowgill / readabs

Download and tidy time series data from the Australian Bureau of Statistics in R
https://mattcowgill.github.io/readabs/
Other
101 stars 22 forks source link

Issue with read_abs function not reading correctly #206

Closed cxm-d closed 2 years ago

cxm-d commented 2 years ago
library(readabs)

x <- readabs::read_abs(tables = "all", series_id = "A3425681K")

Error in utils::download.file(url = url, destfile = destfile, mode = "wb", : cannot open URL 'https://www.abs.gov.au/statistics/economy/national-accounts/australian-national-accounts-finance-and-wealth/latest-release/523202201.xlsx' In addition: Warning message: In utils::download.file(url = url, destfile = destfile, mode = "wb", : cannot open URL 'https://www.abs.gov.au/statistics/economy/national-accounts/australian-national-accounts-finance-and-wealth/latest-release/523202201.xlsx': HTTP status was '404 Not Found'

This call seems to be fetching an incorrect url, not sure if this is something to do with the ABS time series directory (https://abs.gov.au/servlet/TSSearchServlet?)?

Would it be possible to shed some information on this issue?

Cheers!

MattCowgill commented 2 years ago

Hi @cxm-d, thanks for this. It is not a problem with the package per se - it is a problem with the ABS Time Series Directory, as you suspected. I will report this to the ABS and will report back here when it's resolved.

MattCowgill commented 2 years ago

Note to self: emailed ABS dissemination team 2022-06-24 @ 9:04am

cxm-d commented 2 years ago

Note to self: emailed ABS dissemination team 2022-06-24 @ 9:04am

Hi @MattCowgill, issue seems to be resolved now, at least for "A3425681K".

Ty

MattCowgill commented 2 years ago

Yep all done, thanks for bringing it to my attention @cxm-d

longhaivo commented 2 years ago

Hi Matt, I've tried the above command, but it appears there is a new error? library(readabs) x <- readabs::read_abs(tables = "all", series_id = "A3425681K")

Finding filenames for tables corresponding to ABS series ID Attempting to download files from series ID , Australian National Accounts: Finance and Wealth Downloading https://www.abs.gov.au/statistics/economy/national-accounts/australian-national-accounts-finance-and-wealth/latest-release/5232021.xlsx [0%] Downloaded 0 bytes... [0%] Downloaded 0 bytes... Extracting data from downloaded spreadsheets Tidying data from imported ABS spreadsheets Error in .f(.x[[i]], ...) : The data frame appears to have fewer than 2 columns. This is unexpected from an ABS time series. Please check the spreadsheet.

Any advice is appreciated!

MattCowgill commented 2 years ago

Hi @longhaivo, I'm afraid I can't replicate the issue. When I run readabs::read_abs(series_id = "A3425681K") I get the expected tibble returned, without error.

Can you please check what version you're running, with packageVersion("readabs")?

Could you please try installing the latest version from GitHub with remotes::install_github("mattcowgill/readabs")? Thank you

longhaivo commented 2 years ago

Hi @MattCowgill thanks very much for your response. I reinstalled the latest version of the package and can get the function working again! Regards, Long Vo

MattCowgill commented 2 years ago

Excellent @longhaivo, glad to hear your issue is resolved. Please let me know if you encounter any further issues.