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
#>  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 4 2 4
Number subjects - N 4 2 4
Cohort start date - Median [Q25 - Q75] 1937-07-15 [1933-05-09 - 1951-06-20] 1948-01-23 [1943-06-02 - 1952-09-15] 1940-06-07 [1924-11-05 - 1952-01-04]
Range 1924-02-09 to 1989-12-13 1938-10-10 to 1957-05-08 1909-11-14 to 1954-12-17
Cohort end date - Median [Q25 - Q75] 1943-05-21 [1938-12-09 - 1955-12-02] 1954-10-03 [1947-05-02 - 1962-03-06] 1947-05-10 [1934-01-11 - 1954-04-21]
Range 1927-10-12 to 1991-05-08 1939-11-30 to 1969-08-06 1910-07-18 to 1958-09-02
Age - Median [Q25 - Q75] 14 [14 - 15] 26 [25 - 26] 2 [2 - 10]
Mean (SD) 14.75 (2.99) 25.50 (2.12) 9.75 (15.52)
Range 12 to 19 24 to 27 1 to 33
Sex Female N (%) 2 (50.00%) 1 (50.00%) -
Male N (%) 2 (50.00%) 1 (50.00%) 4 (100.00%)
Prior observation - Median [Q25 - Q75] 5,366 [5,060 - 5,888] 9,518 [9,206 - 9,831] 1,224 [956 - 4,075]
Mean (SD) 5,581.50 (1,152.49) 9,518.50 (884.59) 3,806.50 (5,511.05)
Range 4,422 to 7,172 8,893 to 10,144 715 to 12,062
Future observation - Median [Q25 - Q75] 7,123 [3,919 - 9,623] 7,077 [6,870 - 7,284] 5,942 [2,063 - 9,795]
Mean (SD) 6,419.00 (4,094.94) 7,077.00 (586.90) 5,915.75 (4,796.67)
Range 1,407 to 10,023 6,662 to 7,492 1,255 to 10,524
Days in cohort - Median [Q25 - Q75] 1,671 [1,134 - 2,068] 2,446 [1,431 - 3,460] 1,012 [562 - 2,115]
Mean (SD) 1,531.75 (784.14) 2,445.50 (2,868.73) 1,665.25 (1,873.79)
Range 512 to 2,273 417 to 4,474 247 to 4,391
mockDisconnect(cdm) # }