tableCohortCodeUse {CodelistGenerator} | R Documentation |
Format the result of summariseCohortCodeUse into a table.
Description
Format the result of summariseCohortCodeUse into a table.
Usage
tableCohortCodeUse(
result,
type = "gt",
header = c("cdm_name", "estimate"),
splitStrata = TRUE,
conceptId = TRUE,
sourceConcept = TRUE,
timing = FALSE,
groupColumns = NULL,
excludeColumns = c("result_id", "estimate_type", "additional_name", "additional_level"),
.options = list()
)
Arguments
result |
A summarised result with results of the type "cohort_code_use". |
type |
Type of desired formatted table, possibilities: "gt", "flextable", "tibble". |
header |
A vector containing which elements should go into the header
in order. Allowed are: |
splitStrata |
If TRUE strata will be split. |
conceptId |
If TRUE concept ids will be displayed. |
sourceConcept |
If TRUE source concepts will be displayed. |
timing |
If TRUE the timing setting will be displayed. |
groupColumns |
Columns to use as group labels. Allowed columns are
|
excludeColumns |
Columns to drop from the output table. |
.options |
Named list with additional formatting options. visOmopResults::optionsVisOmopTable() shows allowed arguments and their default values. |
Value
A table with a formatted version of the summariseCohortCodeUse result.
Examples
## Not run:
con <- DBI::dbConnect(duckdb::duckdb(),
dbdir = CDMConnector::eunomia_dir())
cdm <- CDMConnector::cdm_from_con(con,
cdm_schem = "main",
write_schema = "main")
cdm <- CDMConnector::generateConceptCohortSet(cdm = cdm,
conceptSet = list(a = 260139,
b = 1127433),
name = "cohorts",
end = "observation_period_end_date",
overwrite = TRUE)
results_cohort_mult <-
summariseCohortCodeUse(list(cs = c(260139,19133873)),
cdm = cdm,
cohortTable = "cohorts",
timing = "entry")
tableCohortCodeUse(results_cohort_mult)
CDMConnector::cdmDisconnect(cdm)
## End(Not run)