Error in load_ips
Closed this issue · 0 comments
giuliaimbu commented
The error occurs because of a zip file that cannot be openned.
> data <- load_ips(dataset = "all", raw_data = TRUE, time_period = 2014)
trying URL 'http://www.ipsamazonia.org.br/assets/IPS_Tabela_Completa-1df30fcea79209e3c7e8634a586f95e6.xlsx'
Content type 'text/html; charset=utf-8' length 1268 bytes
downloaded 1268 bytes
Error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `utils::unzip()`:
! zip file 'C:\Users\Giulia\AppData\Local\Temp\RtmpwxQqsv\file1b1048e6385c.xlsx' cannot be opened
Run `rlang::last_trace()` to see where the error occurred.
> rlang::last_trace()
<error/purrr_error_indexed>
Error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `utils::unzip()`:
! zip file 'C:\Users\Giulia\AppData\Local\Temp\RtmpwxQqsv\file1b1048e6385c.xlsx' cannot be opened
---
Backtrace:
▆
1. ├─datazoom.amazonia::load_ips(...)
2. │ └─datazoom.amazonia:::external_download(...)
3. │ └─param$sheet %>% purrr::map(~readxl::read_xlsx(temp, sheet = .))
4. ├─purrr::map(., ~readxl::read_xlsx(temp, sheet = .))
5. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
6. │ ├─purrr:::with_indexed_errors(...)
7. │ │ └─base::withCallingHandlers(...)
8. │ ├─purrr:::call_with_cleanup(...)
9. │ └─datazoom.amazonia (local) .f(.x[[i]], ...)
10. │ └─readxl::read_xlsx(temp, sheet = .)
11. │ └─readxl:::read_excel_(...)
12. │ ├─readxl:::standardise_sheet(sheet, range, sheets_fun(path))
13. │ │ └─sheet %in% sheet_names
14. │ └─readxl (local) sheets_fun(path)
15. └─readxl (local) `<fn>`(...)
16. └─utils::unzip(zip_path, list = TRUE)
Run rlang::last_trace(drop = FALSE) to see 4 hidden frames.