Download a CIHI indicator .xlsx data table
Usage
morie_ingest_cihi_xlsx(
url,
sheet = NULL,
timeout = 120,
user_agent = "morie/r (+https://github.com/rootcoder007/rmorie)",
wayback_url = NULL,
...
)Arguments
- url
Direct URL of the CIHI .xlsx data table. See
morie_datasets_cihi_data_tablesfor the published catalogue.- sheet
Worksheet name or 1-based index. NULL = largest sheet.
- timeout
HTTP timeout in seconds (default 120).
- user_agent
User-Agent string.
- wayback_url
Optional Internet Archive snapshot URL used as a fallback if the live
urldownload fails (CIHI rotates files).NULL(default) auto-resolves one viarmoriebricklayer::wayback_snapshot_url()when that package is installed;""disables the fallback.- ...
forwarded to readxl::read_excel.
Examples
# \donttest{
if (morie_has("httr2", "readxl")) withAutoprint({
# Any table from the catalogue, e.g. the injury/trauma ED table:
u <- morie_datasets_cihi_data_tables()$url[1]
df <- morie_ingest_cihi_xlsx(u)
})
#> > u <- morie_datasets_cihi_data_tables()$url[1]
#> > df <- morie_ingest_cihi_xlsx(u)
# }
