Decodes Multi Category variables
decode_multi(cohort, coding)
Labeled data frame where multi category columns are decoded
data(coding_dict)
data(cohort)
data(data_dict)
cdata <- merge_coding_data_dict(coding_dict, data_dict)
cohort |>
decode_multi(cdata)
#> # A tibble: 100 × 18
#> participant.p21022 participant.p100240_i0 participant.p100240_i1
#> <dbl> <dbl> <dbl>
#> 1 43 NA 1
#> 2 60 NA NA
#> 3 53 NA 0
#> 4 62 NA NA
#> 5 67 NA NA
#> 6 61 NA NA
#> 7 66 NA NA
#> 8 56 NA NA
#> 9 55 NA NA
#> 10 53 NA NA
#> # ℹ 90 more rows
#> # ℹ 15 more variables: participant.p100240_i2 <dbl>,
#> # participant.p100240_i3 <dbl>, participant.p100240_i4 <dbl>,
#> # participant.p1498_i0 <dbl>, participant.p1498_i1 <dbl>,
#> # participant.p1498_i2 <dbl>, participant.p1508_i0 <dbl>,
#> # participant.p1508_i1 <dbl>, participant.p1508_i2 <dbl>,
#> # participant.p41202 <chr>, participant.p31 <dbl>, …