
Retrieve data for a Statistics Canada data vector released within a given time frame
Source:R/cansim_vectors.R
get_cansim_vector.Rd
Allows for the retrieval of data for specified vector series for a given time window.
Accessing data by vector allows for targeted extraction of time series. Discovering vectors of interest can be achieved
using the StatCan table web interface or using get_cansim_table_template
function to help pinpoint data series of interest, and then chaining the add_cansim_vectors_to_template
function to add
cansim vector information to the template data.
The StatCan API can only process 300 coordinates at a time,
if more than 300 coordinates are specified the function will batch the requests to the API.
Arguments
- vectors
The list of vectors to retrieve
- start_time
Starting date in
YYYY-MM-DD
format, applies toREF_DATE
orreleaseTime
, depending onuse_ref_date
parameter- end_time
Set an optional end time filter in
YYYY-MM-DD
format (defaults to current system time)- use_ref_date
Optional,
TRUE
by default. When set toTRUE
, usesREF_DATE
of vector data to filter, otherwise it uses StatisticsCanada'sreleaseDate
value for filtering the specified vectors.- language
"en"
or"english"
for English and"fr"
or"french"
for French language versions (defaults to English)- refresh
(Optional) When set to
TRUE
, forces a reload of data table (default isFALSE
)- timeout
(Optional) Timeout in seconds for downloading cansim table to work around scenarios where StatCan servers drop the network connection.
- 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")