Evaluate a collection of codings from a character vector

as_coding_list(x)

Arguments

x

A character vector

Value

A list of codings

Examples

char_vec <- c("coding(code('Yes', 1), code('No', 0))", "")
as_coding_list(char_vec)
#> [[1]]
#> <Coding>
#> # A tibble: 2 × 5
#>   link  label value description missing
#>   <chr> <chr> <dbl> <chr>       <lgl>  
#> 1 Yes   Yes       1 Yes         FALSE  
#> 2 No    No        0 No          FALSE  
#> 
#> [[2]]
#> <Empty Coding>
#> 
#> attr(,"class")
#> [1] "coding_lst" "list"