Skip to contents

[Experimental]

Usage

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

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).

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_2
#>  summarising cohort cohort_3
#>  summariseCharacteristics finished!

tableCharacteristics(result)
#> `result_id` is not present in result.
#> `result_id` is not present in result.
#> `result_id` is not present in result.
CDM name
PP_MOCK
Variable name Variable level Estimate name
Cohort name
cohort_1 cohort_2 cohort_3
Number records - N 3 4 3
Number subjects - N 3 4 3
Cohort start date - Median [Q25 - Q75] 1929-02-04 [1922-03-22 - 1953-08-26] 1928-07-26 [1919-01-10 - 1945-07-02] 1955-09-30 [1946-07-14 - 1971-04-12]
Range 1915-05-08 to 1978-03-17 1904-03-10 to 1982-07-02 1937-04-28 to 1986-10-23
Cohort end date - Median [Q25 - Q75] 1933-03-14 [1932-01-13 - 1975-07-30] 1935-03-22 [1932-06-03 - 1947-12-22] 1961-09-18 [1951-02-10 - 1975-06-06]
Range 1930-11-13 to 2017-12-14 1926-09-03 to 1983-07-30 1940-07-03 to 1989-02-21
Age - Median [Q25 - Q75] 6 [4 - 12] 3 [2 - 6] 23 [14 - 31]
Mean (SD) 8.67 (7.37) 5.25 (5.91) 22.00 (17.52)
Range 3 to 17 1 to 14 4 to 39
Sex Female N (%) 2 (66.67%) 3 (75.00%) 2 (66.67%)
Male N (%) 1 (33.33%) 1 (25.00%) 1 (33.33%)
Prior observation - Median [Q25 - Q75] 2,318 [1,744 - 4,281] 1,160 [1,047 - 2,197] 8,696 [5,137 - 11,606]
Mean (SD) 3,244.33 (2,660.34) 2,083.75 (2,151.57) 8,263.67 (6,480.33)
Range 1,171 to 6,244 719 to 5,296 1,578 to 14,517
Future observation - Median [Q25 - Q75] 10,918 [7,170 - 12,790] 14,478 [8,711 - 17,781] 2,563 [2,108 - 2,613]
Mean (SD) 9,667.67 (5,723.86) 12,014.25 (8,279.66) 2,293.00 (556.51)
Range 3,422 to 14,663 525 to 18,576 1,653 to 2,663
Days in cohort - Median [Q25 - Q75] 6,521 [3,584 - 10,520] 2,431 [420 - 5,378] 1,163 [1,008 - 1,672]
Mean (SD) 7,229.00 (6,962.05) 3,367.25 (3,745.69) 1,399.00 (694.74)
Range 648 to 14,518 394 to 8,213 853 to 2,181
mockDisconnect(cdm) # }