get_cansim_changed_series_data_for_vectors: Retrieve data for series that changed, by vector

View source: R/cansim_changed_series.R

get_cansim_changed_series_data_for_vectorsR Documentation

Retrieve data for series that changed, by vector

Description

Retrieve the data points Statistics Canada changed for the given vectors. Series among the ones asked about that did not change contribute no rows, and if none of them changed the result is an empty table rather than an error. The StatCan API can only process 300 vectors at a time, if more than 300 vectors are specified the function will batch the requests to the API.

Usage

get_cansim_changed_series_data_for_vectors(
  vectors,
  language = "english",
  timeout = 200,
  factors = TRUE,
  default_month = "07",
  default_day = "01"
)

Arguments

vectors

The list of vectors to retrieve changed data for

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

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.

factors

(Optional) Logical value indicating if dimensions should be converted to factors. (Default set to TRUE).

default_month

The default month that should be used when creating Date objects for annual data (default set to "07")

default_day

The default day of the month that should be used when creating Date objects for monthly data (default set to "01")

Value

A tibble with the changed data for the specified vector(s)

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

Examples

## Not run: 
get_cansim_changed_series_data_for_vectors("v41690973")

## End(Not run)

cansim documentation built on Aug. 20, 2026, 1:07 a.m.