Skip to contents

Returns the set of categorical values observed for a single (dataset, table, column) triple, sourced from the snapshot embedded under inst/extdata/cvm_codelists_snapshot.csv. The snapshot is built offline by data-raw/build-codelists-snapshot.R from the CVM open-data CSVs.

Usage

cvm_codelist(dataset, table, column, group = NULL)

Arguments

dataset

Short dataset id (e.g. "cad").

table

Table name within the dataset (e.g. "companhias").

column

Snake-case column name (e.g. "sit").

group

Optional CKAN group slug (e.g. "companhias"). When NULL (default) the function resolves by uniqueness across the embedded snapshot. From v0.4 onward, datasets may exist in more than one group; in that case omitting group aborts with cvmdata_error_input_ambiguous.

Value

A tibble with one row per categorical value, sorted alphabetically. Column: value (character).

Details

Inclusion criteria for the snapshot (see CLAUDE.md §9.2): columns whose dictionary dominio enumerates values (e.g. S/N, PF/PJ), and varchar columns with tamanho < 200 and at most 50 distinct values observed in the latest available year.

Examples

cvm_codelist("cad", "companhias", "sit")
#> # A tibble: 3 × 1
#>   value                    
#>   <chr>                    
#> 1 ATIVO                    
#> 2 CANCELADA                
#> 3 SUSPENSO(A) - DECISÃO ADM