cihitbls: Catalogue of CIHI open data-table workbooks (with Wayback...

View source: R/load_cihi.R

cihitblsR Documentation

Catalogue of CIHI open data-table workbooks (with Wayback fallbacks)

Description

Returns the bundled catalogue of the public data-table .xlsx workbooks published on the Canadian Institute for Health Information (CIHI) “Access data and reports > Data tables” page (https://www.cihi.ca/en/access-data-and-reports/data-tables). Each row carries the table title, its direct url, and a wayback_url snapshot on the Internet Archive so the table stays retrievable even if CIHI rotates or removes the live file.

Usage

cihitbls(archonly = FALSE)

Arguments

archonly

If TRUE, drop rows with no Wayback snapshot. Default FALSE (return the full catalogue).

Details

Download any row with cihiget(), which tries url first and falls back to wayback_url. The Wayback snapshots were resolved with rmoriebricklayer::wbsnpurl().

Value

A data.frame with columns title, url, wayback_url.

Source

Canadian Institute for Health Information, Data tables (https://www.cihi.ca/en/access-data-and-reports/data-tables). Snapshotted to the Internet Archive (https://web.archive.org). Catalogue current as of 2026-07.

Examples

# Full catalogue: title, live url, Wayback snapshot url.
cat <- cihitbls()
nrow(cat)
names(cat)
head(cat$title, 3)

# `archonly = TRUE` keeps only rows that have a Wayback snapshot,
# i.e. tables still retrievable if CIHI rotates the live file.
arch <- cihitbls(archonly = TRUE)
nrow(arch) # <= nrow(cat)
all(nzchar(arch$wayback_url)) # TRUE

# Find a table by keyword before fetching it.
cat$title[grepl("hospital", cat$title, ignore.case = TRUE)][1:3]

rmoriedata documentation built on Nov. 18, 2026, 5:06 p.m.