Skip to contents

[Experimental]

Usage

tableCharacteristics(
  result,
  type = "gt",
  header = c("cdm_name", "cohort_name"),
  groupColumn = character(),
  hide = c(additionalColumns(result), settingsColumns(result)),
  .options = list()
)

Arguments

result

A summarised_result object.

type

Type of table. Check supported types with visOmopResults::tableType().

header

Columns to use as header. See options with availableTableColumns(result).

groupColumn

Columns to group by. See options with availableTableColumns(result).

hide

Columns to hide from the visualisation. See options with availableTableColumns(result).

.options

A named list with additional formatting options. visOmopResults::tableOptions() shows allowed arguments and their default values.

Value

A formatted table.

Examples

# \donttest{
library(CohortCharacteristics)

cdm <- mockCohortCharacteristics()

result <- summariseCharacteristics(cdm$cohort1)
#>  adding demographics columns
#>  summarising data
#>  summarising cohort cohort_1
#>  summarising cohort cohort_3
#>  summariseCharacteristics finished!

tableCharacteristics(result)
CDM name
PP_MOCK
Variable name Variable level Estimate name
Cohort name
cohort_1 cohort_3
Number records - N 4 6
Number subjects - N 4 6
Cohort start date - Median [Q25 - Q75] 1965-10-09 [1954-06-28 - 1974-01-30] 1939-05-27 [1920-10-18 - 1965-02-28]
Range 1935-04-26 to 1984-05-02 1911-08-13 to 1979-06-02
Cohort end date - Median [Q25 - Q75] 1967-10-04 [1957-02-14 - 1975-01-07] 1942-07-08 [1927-02-12 - 1966-07-06]
Range 1937-08-11 to 1984-06-02 1916-06-11 to 1980-06-06
Age - Median [Q25 - Q75] 24 [15 - 28] 13 [6 - 28]
Mean (SD) 20.25 (11.84) 18.17 (15.89)
Range 4 to 30 3 to 43
Sex Female N (%) 1 (25.00%) 3 (50.00%)
Male N (%) 3 (75.00%) 3 (50.00%)
Prior observation - Median [Q25 - Q75] 8,864 [5,841 - 10,620] 4,827 [2,644 - 10,284]
Mean (SD) 7,596.00 (4,343.80) 6,828.33 (5,815.56)
Range 1,583 to 11,072 1,320 to 15,977
Future observation - Median [Q25 - Q75] 694 [435 - 1,141] 3,946 [2,619 - 5,626]
Mean (SD) 881.50 (714.23) 4,626.00 (3,087.41)
Range 260 to 1,878 1,493 to 10,010
Days in cohort - Median [Q25 - Q75] 643 [343 - 880] 1,139 [551 - 1,620]
Mean (SD) 580.50 (433.92) 1,231.83 (914.61)
Range 32 to 1,004 263 to 2,714
mockDisconnect(cdm) # }