Skip to contents

[Experimental]

Usage

tableCharacteristics(
  result,
  type = "gt",
  header = c("cdm_name", "cohort_name"),
  groupColumn = NULL,
  hide = character()
)

Arguments

result

A summarised_result object. Output of summariseCharacteristics().

type

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

header

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

groupColumn

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

hide

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

Value

A table with a formatted version of the summariseCharacteristics result.

Examples

# \donttest{
library(CohortCharacteristics)

cdm <- mockCohortCharacteristics()

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

tableCharacteristics(result)
#> ! Results have not been suppressed.
CDM name
PP_MOCK
Variable name Variable level Estimate name
Cohort name
cohort_1 cohort_2 cohort_3
Number records - N 5 3 2
Number subjects - N 5 3 2
Cohort start date - Median [Q25 - Q75] 1912-12-01 [1909-02-13 - 1950-12-30] 1957-07-30 [1949-06-16 - 1969-03-19] 1964-01-29 [1962-07-06 - 1965-08-23]
Range 1905-03-16 to 1954-05-29 1941-05-02 to 1980-11-06 1960-12-10 to 1967-03-19
Cohort end date - Median [Q25 - Q75] 1924-11-14 [1921-05-25 - 1964-10-31] 1964-04-25 [1961-04-26 - 1975-11-19] 1971-10-07 [1969-06-28 - 1974-01-16]
Range 1908-12-17 to 1968-04-04 1958-04-26 to 1987-06-14 1967-03-20 to 1976-04-26
Age - Median [Q25 - Q75] 4 [2 - 5] 13 [10 - 15] 15 [14 - 16]
Mean (SD) 3.40 (2.41) 12.67 (4.51) 15.00 (2.83)
Range 0 to 6 8 to 17 13 to 17
Sex Male N (%) 5 (100.00%) 2 (66.67%) 1 (50.00%)
Prior observation - Median [Q25 - Q75] 1,824 [774 - 2,161] 5,058 [4,095 - 5,694] 5,689 [5,257 - 6,121]
Mean (SD) 1,434.60 (972.97) 4,840.33 (1,610.57) 5,689.00 (1,221.88)
Range 74 to 2,340 3,132 to 6,331 4,825 to 6,553
Future observation - Median [Q25 - Q75] 7,186 [7,054 - 7,335] 5,599 [4,581 - 8,761] 4,218 [2,110 - 6,326]
Mean (SD) 6,507.40 (1,887.53) 7,028.33 (4,359.43) 4,218.00 (5,962.32)
Range 3,168 to 7,794 3,563 to 11,923 2 to 8,434
Days in cohort - Median [Q25 - Q75] 5,055 [3,098 - 5,060] 2,462 [2,437 - 4,333] 2,810 [1,406 - 4,213]
Mean (SD) 4,068.00 (1,803.11) 3,692.67 (2,175.02) 2,809.50 (3,970.40)
Range 1,373 to 5,754 2,412 to 6,204 2 to 5,617
Sex Female N (%) - 1 (33.33%) 1 (50.00%)
mockDisconnect(cdm) # }