cansim (version 0.2.3)

get_cansim: 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(cansimTableNumber, language = "english", refresh = FALSE)

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)

Value

tibble format data table output

Examples

Run this code
# NOT RUN {
# 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")

# }

Run the code above in your browser using DataLab