OCHA-DAP / ripc

Download and Tidy IPC and CH Data
GNU General Public License v3.0
2 stars 1 forks source link

Run `ipc_download()` and got "Error: Can't establish that the input is either xls or xlsx." #1

Closed gnoblet closed 1 year ago

gnoblet commented 1 year ago

Hello @caldwellst,

I encountered the following error while running ipc_download(): "Error: Can't establish that the input is either xls or xlsx."

R.version _
platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 2.1
year 2022
month 06
day 23
svn rev 82513
language R
version.string R version 4.2.1 (2022-06-23 ucrt) nickname Funny-Looking Kid

Rhdx version : ‘0.1.0.9000’

caldwellst commented 1 year ago

Hello @gnoblet, could you provide the traceback? I am unable to replicate the error. It sounds like an error within Rhdx and full trace stack would help explore more.

gnoblet commented 1 year ago

Here it is:

9: stop("Can't establish that the input is either xls or xlsx.", call. = FALSE) 8: check_format(path) 7: read_excel(file, sheet = sheet, ...) 6: read_hdx_excel(file_path, sheet = sheet, hxl = hxl, ...) 5: resource$read_resource(sheet = sheet, layer = layer, format = format, download_folder = download_folder, simplify_json = simplify_json, force_download = force_download, quiet_download = quiet_download, ...) 4: rhdx::read_resource(resource = res, sheet = "IPC") 3: withCallingHandlers(expr, message = function(c) if (inherits(c, classes)) tryInvokeRestart("muffleMessage")) 2: suppressMessages(rhdx::read_resource(resource = res, sheet = "IPC")) 1: ipc_download()

caldwellst commented 1 year ago

Thanks! And sorry, another thing, can you tell me what version of readxl, rhdx, and ripc you have?

gnoblet commented 1 year ago

No worries at all!

packageVersion("Ripc") [1] ‘0.0.1’ packageVersion("rhdx") [1] ‘0.1.0.9000’ packageVersion("readxl") [1] ‘1.4.1’

caldwellst commented 1 year ago

I was never able to replicate this error, but took the move to switch the front end from the rhdx library and instead call directly from the IPC API. I have provided lots of documentation on how to do that, so hope that's helpful. More importantly, the API is updated more frequently the IPC file on HDX, so should be better at getting the most recent analyses. Let me know if you keep using the package!

caldwellst commented 1 year ago

Will close now as have deprecated the HDX functionality.