Pivots the input dataframe so the values of the column strata_name are transformed into columns that contain values from the strata_level column.
Examples
mockSummarisedResult() |>
splitStrata()
#> # A tibble: 126 × 13
#> result_id cdm_name group_name group_level age_group sex variable_name
#> <int> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 1 mock cohort_name cohort1 overall overall number subjects
#> 2 1 mock cohort_name cohort1 <40 Male number subjects
#> 3 1 mock cohort_name cohort1 >=40 Male number subjects
#> 4 1 mock cohort_name cohort1 <40 Female number subjects
#> 5 1 mock cohort_name cohort1 >=40 Female number subjects
#> 6 1 mock cohort_name cohort1 overall Male number subjects
#> 7 1 mock cohort_name cohort1 overall Female number subjects
#> 8 1 mock cohort_name cohort1 <40 overall number subjects
#> 9 1 mock cohort_name cohort1 >=40 overall number subjects
#> 10 1 mock cohort_name cohort2 overall overall number subjects
#> # ℹ 116 more rows
#> # ℹ 6 more variables: variable_level <chr>, estimate_name <chr>,
#> # estimate_type <chr>, estimate_value <chr>, additional_name <chr>,
#> # additional_level <chr>