Issue with read_abs function not reading correctly
cxm-d opened this issue · comments
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!
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.
Note to self: emailed ABS dissemination team 2022-06-24 @ 9:04am
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
Yep all done, thanks for bringing it to my attention @cxm-d
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!
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
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
Excellent @longhaivo, glad to hear your issue is resolved. Please let me know if you encounter any further issues.