Reshapes the long/tidy output of get_estat() into wide form, spreading the
labels of one classification axis across columns. Mirrors tidycensus's
output = "wide", but as an explicit opt-in step rather than the default.
Arguments
- data
A tibble or data.frame from
get_estat()(withdecode_labels).- names_from
Column whose values become the new column names (e.g.
"cat01"). Its paired_codecolumn is dropped from the id set.- values_from
Column holding the cell values to spread. Defaults to
"value".- id_cols
Columns identifying each output row. Defaults to every column except
names_from(and its_codepartner),values_from, andannotation.
Value
A wide tibble, one row per unique combination of
id_cols.
Examples
if (FALSE) { # \dontrun{
d <- get_estat("0003217721", limit = 500)
pivot_estat_wide(d, names_from = "cat01")
} # }