
Fetch a Statistics Canada NDM / cansim table
Source:R/ingest_statcan.R
morie_ingest_statcan_cansim.RdConvenience wrapper around the CRAN cansim package, which
talks to the Statistics Canada NDM ("cansim") tabular data API.
Use this for canonical CANSIM tables (e.g. "35-10-0177-01")
rather than for PUMF _CSV.zip downloads — those go
through morie_ingest_statcan_csv.
Usage
morie_ingest_statcan_cansim(
table_id,
language = c("eng", "fra"),
refresh = FALSE,
...
)Arguments
- table_id
A StatCan / NDM table identifier, e.g.
"35-10-0177"or"35-10-0177-01".- language
One of
"eng"or"fra".- refresh
Carried for interface compatibility: the native WDS fetch keeps no on-disk cache, so every call re-downloads and the argument has no effect.
- ...
Further arguments forwarded to
get_cansim.
Details
No credentials are required: the StatCan Web Data Service is
public. Setting the optional STATCAN_API_KEY environment
variable only raises your WDS rate limits; without it the fetch
still works (it is forwarded to cansim via the
CANSIM_API_KEY name the package reads internally).
Examples
if (FALSE) { # \dontrun{
# Requires the 'cansim' package and network access.
df <- morie_ingest_statcan_cansim("35-10-0177")
head(df)
} # }