Skip to contents

Retrieves specific data series by their StatCan vector identifiers through the public Web Data Service getDataFromVectorsAndLatestNPeriods endpoint. This is the small, targeted alternative to morie_ingest_statcan_cansim, which downloads a whole table (millions of rows). No credentials are required; the WDS is public. The POST runs through rmorie's native libcurl backend — no extra package dependency.

Usage

morie_ingest_statcan_vectors(vectors, periods = 12L, timeout = 60L)

Arguments

vectors

Character or numeric StatCan vector IDs. A leading "v" is accepted and stripped (e.g. "v41690973" or 41690973).

periods

Number of most-recent reference periods to return per vector.

timeout

Per-request timeout, seconds.

Value

A base R data.frame, one row per (vector, period): vector, ref_date, value, decimals, scalar_factor, symbol_code, release_time.

Examples

# \donttest{
# Two CPI series, last 3 periods each -- no API key needed.
morie_ingest_statcan_vectors(c("v41690973", "v41691045"), periods = 3)
#>     vector   ref_date value decimals scalar_factor symbol_code     release_time
#> 1 41690973 2026-04-01 168.0        1             0           0 2026-05-19T08:30
#> 2 41690973 2026-05-01 169.6        1             0           0 2026-06-22T08:30
#> 3 41690973 2026-06-01 169.0        1             0           0 2026-07-20T08:30
#> 4 41691045 2026-04-01 182.7        1             0           0 2026-05-19T08:30
#> 5 41691045 2026-05-01 184.5        1             0           0 2026-06-22T08:30
#> 6 41691045 2026-06-01 182.1        1             0           0 2026-07-20T08:30
# }