Skip to contents

Phase 3DDD3. Wraps the getDataFromVectorsAndLatestNPeriods POST endpoint. A "vector" is StatCan's atomic time series ID (e.g., v109502878 for "Canada – Total, all violations").

Usage

morie_datasets_statcan_vectors(vector_ids, n_periods = 5L, timeout_s = 60L)

Arguments

vector_ids

Integer vector of StatCan vector IDs (no v prefix; the API takes raw integers).

n_periods

Number of latest periods per vector (default 5).

timeout_s

HTTP timeout.

Value

A data.frame with one row per (vector, period) observation: vector_id, coordinate, ref_period, value, decimals, status, symbol, scalar_factor.

Examples

# \donttest{
df <- try(morie_datasets_statcan_vectors(c(109502878L, 109502879L),
                                            n_periods = 3))
if (!inherits(df, "try-error")) nrow(df)  # ~6
#> [1] 6
# }