Skip to contents

Returns table information given an NDM table catalogue number in English or French. Retrieved table information data is cached for the duration of the R session only.

Usage

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

Arguments

cansimTableNumber

the NDM table number to load

language

"english" (the default) or "french". Short forms such as "en", "eng", "fr" or "fra" are accepted, as are the French names "anglais" and "francais"; case and accents are ignored

refresh

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

timeout

(Optional) Number of seconds StatCan is allowed to go without sending data before the download is abandoned, to work around scenarios where StatCan servers drop the network connection. This does not limit how long a download may take overall, a transfer that keeps delivering data is left alone. StatCan prepares a whole response before sending any of it, which for large requests can take the better part of a minute, so values much below the default of 200 risk cutting off legitimate requests.

Value

A tibble with the table overview information

Returns NULL if the data could not be retrieved because StatCan is unavailable.

Examples

# \donttest{
get_cansim_table_info("34-10-0013")
#> # A tibble: 1 × 7
#>   `Cube Title`               `Product Id` `CANSIM Id` `Archive Status` Frequency
#>   <chr>                      <chr>        <chr>       <chr>            <chr>    
#> 1 Residential property valu… 34-10-0013   026-0018    CURRENT - a cub… 12       
#> # ℹ 2 more variables: `Start Reference Period` <chr>,
#> #   `End Reference Period` <chr>
# }