
Retrieve table metadata from Statistics Canada API
Source:R/cansim_metadata.R
get_cansim_cube_metadata.RdRetrieves table metadata given an input table number or vector of table numbers using either the new or old table number format. Patience is suggested as the Statistics Canada API can be very slow. The `list_cansim_tables()` function can be used as an alternative to retrieve a (cached) list of CANSIM tables with (more limited) metadata.
Value
a tibble containing the table metadata. When several table numbers are given, the metadata for all tables is retrieved in a single API call and the results are stacked. Types other than "overview" carry no table identifier of their own, for those a `cansimTableNumber` column is added to identify the table.
Returns NULL if the data could not be retrieved because StatCan is unavailable.
Examples
# \donttest{
get_cansim_cube_metadata("34-10-0013")
#> # A tibble: 1 × 17
#> responseStatusCode productId cansimId cubeTitleEn cubeTitleFr cubeStartDate
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 0 34-10-0013 026-0018 Residential … Valeurs de… 2005-01-01
#> # ℹ 11 more variables: cubeEndDate <chr>, frequencyCode <chr>,
#> # nbSeriesCube <chr>, nbDatapointsCube <chr>, releaseTime <dttm>,
#> # archiveStatusCode <chr>, archiveStatusEn <chr>, archiveStatusFr <chr>,
#> # subjectCode <chr>, surveyCode <chr>, issueDate <chr>
# }