Skip to contents

[Experimental] Provides tools for obtaining a tidy version of a summarised_result object. This tidy version will include the settings as columns, estimate_value will be pivotted into columns using estimate_name as names, and group, strata, and additional will be splitted. If you want to customise these tidy operations, please use tidySummarisedResult().

Usage

# S3 method for class 'summarised_result'
tidy(x, ...)

Arguments

x

A summarised_result.

...

For compatibility (not used).

Value

A tibble.

Examples

result <- mockSummarisedResult()
result |> tidy()
#> # A tibble: 72 × 13
#>    cdm_name cohort_name age_group sex     variable_name   variable_level   count
#>    <chr>    <chr>       <chr>     <chr>   <chr>           <chr>            <int>
#>  1 mock     cohort1     overall   overall number subjects NA              618772
#>  2 mock     cohort1     <40       Male    number subjects NA             4155690
#>  3 mock     cohort1     >=40      Male    number subjects NA               51456
#>  4 mock     cohort1     <40       Female  number subjects NA             8239530
#>  5 mock     cohort1     >=40      Female  number subjects NA             6727117
#>  6 mock     cohort1     overall   Male    number subjects NA             6593947
#>  7 mock     cohort1     overall   Female  number subjects NA             3247091
#>  8 mock     cohort1     <40       overall number subjects NA             1003000
#>  9 mock     cohort1     >=40      overall number subjects NA             4758681
#> 10 mock     cohort2     overall   overall number subjects NA             2169996
#> # ℹ 62 more rows
#> # ℹ 6 more variables: mean <dbl>, sd <dbl>, percentage <dbl>,
#> #   result_type <chr>, package_name <chr>, package_version <chr>