Skip to contents

Adds two columns to the output of get_ipca(): snipc, the SNIPC code that prefixes each description (1 digit for groups, 2 for subgroups, 4 for items and 7 for sub-items), and group, the hierarchy level as a label ("Geral", "Grupo", "Subgrupo", "Item" or "Subitem"). The group column is what the core functions use to pick items (core_ma(), core_ms()) or sub-items (core_p55(), core_difusao()).

Usage

group_desc(data)

Arguments

data

Output from get_ipca() (a tibble, or the list returned with unite = FALSE).

Value

Tibble (or list of tibbles) with the new columns snipc and group.

Author

Fernando da Silva <fernando@fortietwo.com>

Examples

if (FALSE) { # \dontrun{
library(magrittr)
my_df <- get_ipca(table = 7060, period = "last") %>%
group_desc()
} # }