A `coding` object holds a list of `code`s that map vector values to human readable labels. An abstraction of factors, this data structure is designed to be portable and not directly attached to the underlying data. Moreover, `coding` objects can be "linked" for recoding and data lineage purposes. An "empty coding" is used to represent data that has no categorical interpretation.

coding(..., .label = NULL)

empty_coding()

Arguments

...

A collection of `code` objects

.label

A label for this coding, available for interoperability

Value

A `coding` object that contains each `code` input

Examples

coding(code("Yes", 1), code("No", 0), code("Not applicable", NA))
#> <Coding>
#> # A tibble: 3 × 5
#>   link           label          value description    missing
#>   <chr>          <chr>          <dbl> <chr>          <lgl>  
#> 1 Yes            Yes                1 Yes            FALSE  
#> 2 No             No                 0 No             FALSE  
#> 3 Not applicable Not applicable    NA Not applicable TRUE   
empty_coding()
#> <Empty Coding>