get_cansim_ndm {cansim}R Documentation

Retrieves a Statistics Canada data table using CANSIM code or NDM table number

Description

Retrieves a data table as a tidy dataframe using either an old-style CANSIM code or a new-format NDM table number. This function will automatically convert old-style CANSIM codes into their new equivalents. Retrieved table data is cached for the duration of the current R session only by default.

Usage

get_cansim_ndm(
  cansimTableNumber,
  language = "english",
  refresh = FALSE,
  timeout = 200
)

Arguments

cansimTableNumber

the table number to load, accepts old CANSIM or new NDM table numbers

language

"en" or "english" for English and "fr" or "french" for French language versions (default is set to English)

refresh

(Optional) When set to TRUE, forces a reload of data table (default is FALSE)

timeout

(Optional) Timeout in seconds for downloading cansim table to work around scenarios where StatCan servers drop the network connection.

Details

Deprecated, use 'get_cansim' instead. This will be removed in future releases.

Value

A tibble with the StatCan table data

Examples


# Retrieve a table with an NDM code
get_cansim("34-10-0013")
# Retrieve a table with an old-style CANSIM code
get_cansim("026-0018")


[Package cansim version 0.3.8 Index]