Skip to contents

Create a visual table from a summariseMissingData() result

Usage

tableMissingData(
  result,
  header = "cdm_name",
  hide = c("variable_name", omopgenerics::settingsColumns(result)),
  groupColumn = c("omop_table", omopgenerics::strataColumns(result)),
  type = NULL,
  style = NULL
)

Arguments

result

A summarised_result object (output of summariseMissingData()).

header

A vector specifying the elements to include in the header. The order of elements matters, with the first being the topmost header.

hide

Columns to drop from the output table.

groupColumn

Columns to use as group labels, to see options use visOmopResults::tableColumns(result).

type

Character string specifying the desired output table format. See visOmopResults::tableType() for supported table types. If type = NULL, global options (set via visOmopResults::setGlobalTableOptions()) will be used if available; otherwise, a default 'gt' table is created.

style

Defines the visual formatting of the table. This argument can be provided in one of the following ways:

  1. Pre-defined style: Use the name of a built-in style (e.g., "darwin"). See visOmopResults::tableStyle() for available options.

  2. YAML file path: Provide the path to an existing .yml file defining a new style.

  3. List of custome R code: Supply a block of custom R code or a named list describing styles for each table section. This code must be specific to the selected table type.

If style = NULL, the function will use global options (seevisOmopResults::setGlobalTableOptions()) or a _brand.yml file (if found); otherwise, the default style is applied.

Value

A formatted table visualisation.

Examples

# \donttest{
library(OmopSketch)
library(omock)

cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
#>  Loading bundled GiBleed tables from package data.
#>  Adding drug_strength table.
#>  Creating local <cdm_reference> object.
#>  Inserting <cdm_reference> into duckdb.

result <- summariseMissingData(
  cdm = cdm,
  omopTableName = c("condition_occurrence", "visit_occurrence")
)
#> The person table has ≤ 1e+05 subjects; skipping sampling of the CDM.

tableMissingData(result = result)
Summary of missingness in condition_occurrence, visit_occurrence tables
Column name Estimate name
Database name
GiBleed
visit_occurrence
admitting_source_concept_id N missing data (%) 0 (0.00%)
N zeros (%) 1,037 (100.00%)
admitting_source_value N missing data (%) 1,037 (100.00%)
care_site_id N missing data (%) 1,037 (100.00%)
N zeros (%) 0 (0.00%)
discharge_to_concept_id N missing data (%) 0 (0.00%)
N zeros (%) 1,037 (100.00%)
discharge_to_source_value N missing data (%) 1,037 (100.00%)
person_id N missing data (%) 0 (0.00%)
N zeros (%) 0 (0.00%)
preceding_visit_occurrence_id N missing data (%) 0 (0.00%)
N zeros (%) 0 (0.00%)
provider_id N missing data (%) 1,037 (100.00%)
N zeros (%) 0 (0.00%)
visit_concept_id N missing data (%) 0 (0.00%)
N zeros (%) 0 (0.00%)
visit_end_date N missing data (%) 0 (0.00%)
visit_end_datetime N missing data (%) 0 (0.00%)
visit_occurrence_id N missing data (%) 0 (0.00%)
N zeros (%) 0 (0.00%)
visit_source_concept_id N missing data (%) 0 (0.00%)
N zeros (%) 1,037 (100.00%)
visit_source_value N missing data (%) 0 (0.00%)
visit_start_date N missing data (%) 0 (0.00%)
visit_start_datetime N missing data (%) 0 (0.00%)
visit_type_concept_id N missing data (%) 0 (0.00%)
N zeros (%) 0 (0.00%)
condition_occurrence
condition_concept_id N missing data (%) 0 (0.00%)
N zeros (%) 0 (0.00%)
condition_end_date N missing data (%) 8,652 (13.24%)
condition_end_datetime N missing data (%) 8,652 (13.24%)
condition_occurrence_id N missing data (%) 0 (0.00%)
N zeros (%) 0 (0.00%)
condition_source_concept_id N missing data (%) 0 (0.00%)
N zeros (%) 0 (0.00%)
condition_source_value N missing data (%) 0 (0.00%)
condition_start_date N missing data (%) 0 (0.00%)
condition_start_datetime N missing data (%) 0 (0.00%)
condition_status_concept_id N missing data (%) 0 (0.00%)
N zeros (%) 65,332 (100.00%)
condition_status_source_value N missing data (%) 65,332 (100.00%)
condition_type_concept_id N missing data (%) 0 (0.00%)
N zeros (%) 0 (0.00%)
person_id N missing data (%) 0 (0.00%)
N zeros (%) 0 (0.00%)
provider_id N missing data (%) 65,332 (100.00%)
N zeros (%) 0 (0.00%)
stop_reason N missing data (%) 65,332 (100.00%)
visit_detail_id N missing data (%) 0 (0.00%)
N zeros (%) 65,332 (100.00%)
visit_occurrence_id N missing data (%) 64 (0.10%)
N zeros (%) 0 (0.00%)
cdmDisconnect(cdm = cdm) # }