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             5518207
#>  2 mock     cohort1     <40       Male    number subjects NA             9262120
#>  3 mock     cohort1     >=40      Male    number subjects NA             5830144
#>  4 mock     cohort1     <40       Female  number subjects NA              745444
#>  5 mock     cohort1     >=40      Female  number subjects NA             1032387
#>  6 mock     cohort1     overall   Male    number subjects NA             9288374
#>  7 mock     cohort1     overall   Female  number subjects NA             2535113
#>  8 mock     cohort1     <40       overall number subjects NA             2286501
#>  9 mock     cohort1     >=40      overall number subjects NA             3285193
#> 10 mock     cohort2     overall   overall number subjects NA             3804787
#> # ℹ 62 more rows
#> # ℹ 6 more variables: mean <dbl>, sd <dbl>, percentage <dbl>,
#> #   result_type <chr>, package_name <chr>, package_version <chr>