Skip to contents

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

Usage

formatCharacteristics(
  result,
  type = "gt",
  splitStrata = TRUE,
  format = c(`N (%)` = "<count> (<percentage>%)", N = "<count>",
    "<median> [<q25> - <q75>]", "<mean> (<sd>)", range = "<min> to <max>"),
  cdmName = TRUE,
  cohortName = TRUE,
  style = "default",
  minCellCount = 5,
  .options = list()
)

Arguments

result

A summarised_characteristics object.

type

Type of desired formatted table, possibilities: "gt", "flextable", "tibble".

splitStrata

Whether or not to split the strata, default is True.

format

The columns that the user wishes to see for the formatted table.

cdmName

Whether or not to display the cdm name, default is TRUE.

cohortName

Weather or not to display the cohort name, default is TRUE.

style

The style of the table output.

minCellCount

Default is 5, meaning results that are more than 0 but less than 5 will not be reported.

.options

See optionsTableCharacteristics() for default values.

Value

A tibble with a tidy version of the summarised_characteristics object.

Examples

# \donttest{
library(PatientProfiles)

cdm <- mockPatientProfiles()

cdm$cohort1 |>
  summariseCharacteristics()
#> Warning: `summariseCharacteristics()` was deprecated in PatientProfiles 0.8.0.
#>  Please use `CohortCharacteristics::summariseCharacteristics()` instead.
#>  adding demographics columns
#>  summarising data
#>  The following estimates will be computed:
#>  variable_00002: count, percentage
#>  cohort_start_date: min, q05, q25, median, q75, q95, max
#>  cohort_end_date: min, q05, q25, median, q75, q95, max
#>  variable_00004: min, q05, q25, median, q75, q95, max, mean, sd
#>  variable_00005: min, q05, q25, median, q75, q95, max, mean, sd
#>  variable_00003: 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:23.7403
#>  Summary finished, at 2024-05-11 12:03:23.853025
#>  summariseCharacteristics finished!
#> # A tibble: 45 × 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     
#> # ℹ 35 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)
# }