Skip to contents

Converts the long-format output of arad_get() into one row per period and one column per series. Snapshot identifiers are incorporated into column names automatically when they are needed to distinguish multiple snapshot contexts for the same indicator.

Usage

arad_wide(
  data,
  snapshot = c("auto", "include", "ignore"),
  names_sep = "__"
)

Arguments

data

A data frame with indicator_id, period, and value columns, typically returned by arad_get().

snapshot

How snapshot identifiers should affect column names: "auto" adds them only when an indicator has multiple snapshot contexts, "include" always adds them, and "ignore" never adds them.

names_sep

Separator used between indicator and snapshot identifiers.

Value

A tibble with one period column and one numeric column per series. The arad_diagnostics attribute is preserved when present on data.