Skip to contents

`r lifecycle::badge("deprecated")`

Usage

gtResult(
  summarisedResult,
  long,
  wide,
  format = c(`N (%)` = "count (percentage%)", "median [min; q25 - q75; max]",
    "mean (sd)", "median [q25 - q75]", N = "count"),
  keepNotFormatted = TRUE,
  decimals = c(default = 0),
  decimalMark = ".",
  bigMark = ","
)

Arguments

summarisedResult

A SummarisedResult object.

long

List of variables and specification to long.

wide

List of variables and specification to wide.

format

formats and labels to use.

keepNotFormatted

Whether to keep not formatted estimate types.

decimals

Decimals per estimate_type.

decimalMark

decimal mark.

bigMark

big mark.

Value

A formatted summarisedResult gt object.

Examples

# \donttest{
library(PatientProfiles)

cdm <- mockPatientProfiles()

cdm$cohort1 %>%
  summariseCharacteristics(
    ageGroup = list(c(0, 19), c(20, 39), c(40, 59), c(60, 79), c(80, 150))
  )
#>  adding demographics columns
#>  summarising data
#>  The following estimates will be computed:
#>  variable_00006: count, percentage
#>  variable_00010: count, percentage
#>  cohort_start_date: min, q05, q25, median, q75, q95, max
#>  cohort_end_date: min, q05, q25, median, q75, q95, max
#>  variable_00008: min, q05, q25, median, q75, q95, max, mean, sd
#>  variable_00009: min, q05, q25, median, q75, q95, max, mean, sd
#>  variable_00007: min, q05, q25, median, q75, q95, max, mean, sd
#> ! Table is collected to memory as not all requested estimates are supported on
#>   the database side
#> → Start summary of data, at 2024-05-11 12:03:27.36159
#>  Summary finished, at 2024-05-11 12:03:27.480952
#>  summariseCharacteristics finished!
#> # A tibble: 47 × 13
#>    result_id cdm_name group_name  group_level strata_name strata_level
#>        <int> <chr>    <chr>       <chr>       <chr>       <chr>       
#>  1         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  2         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  3         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  4         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  5         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  6         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  7         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  8         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  9         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#> 10         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#> # ℹ 37 more rows
#> # ℹ 7 more variables: variable_name <chr>, variable_level <chr>,
#> #   estimate_name <chr>, estimate_type <chr>, estimate_value <chr>,
#> #   additional_name <chr>, additional_level <chr>
CDMConnector::cdmDisconnect(cdm = cdm)
# }