Opening/reading an excel file in r

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Opening/reading an excel file in r



I am having trouble opening/reading excel files that I download from the website of the Australian Bureau of Statistics using readxl.



I've downloaded Table 12 from the website but when I go to read the sheets of the workbook in r I get an error message:


r


library(readxl)
excel_sheets(path = "C:/Users/Name/Documents/downloaded_file.xls")

"Error in xls_sheets(path) : Failed to open C:/Users/Name/Documents/downloaded_file.xls".



In previous versions of readxl I have had no trouble reading these files into r but I've recently updated my readxl version, after a hiatus of several months, and now it doesn't work.


readxl


r



I have tried to download the file using the download.file function taking care to set mode = wb but that makes no difference to being able to access the data in the workbook either.


download.file


mode = wb



Grateful for any pointers.





The file is a "Composite Document File V2 Document", so it contains "streams" other than normal excel data. Sounds like someone did some "advanced authoring" on or near this file :-). I'm not familiar with tools in R that read it, nor any (non-R) tools that might separate the streams for you.
– r2evans
23 mins ago







Thanks for that @r2evans. How did you work that out?
– Dom
19 mins ago





Downloaded it and ran file 6202001.xls, which reported the format as such. I haven't tried any of the other files on the same page, so it's possible it's just a one-off problem that staff accidentally dorked when handling the files. If you have a mechanism to ask them about it, perhaps they can regenerate or fix the file.
– r2evans
5 mins ago


file 6202001.xls









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Makefile test if variable is not empty

Will Oldham

Visual Studio Code: How to configure includePath for better IntelliSense results