tableOrphanCodes: Format the result of summariseOrphanCodes into a visual...

View source: R/tableAchillesCodeUse.R

tableOrphanCodesR Documentation

Format the result of summariseOrphanCodes into a visual table.

Description

[Experimental]

Usage

tableOrphanCodes(
  result,
  type = "gt",
  header = c("cdm_name", "estimate"),
  conceptId = TRUE,
  standard = TRUE,
  vocabulary = TRUE,
  relationship = TRUE,
  groupColumns = NULL,
  settings = character(),
  excludeColumns = c("result_id", "estimate_type"),
  .options = list()
)

Arguments

result

A summarised result with results of the type "orphan_codes".

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: cdm_name, group, strata, additional, variable, estimate, settings.

conceptId

If TRUE concept ids will be displayed.

standard

If TRUE a column indicating if the code is standard will be displayed.

vocabulary

If TRUE vocabulary id will be displayed.

relationship

If TRUE relationship id will be displayed.

groupColumns

Columns to use as group labels. Allowed columns are cdm_name and/or codelist_name.

settings

Vector with the settings columns to display.

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 summariseOrphanCodes result.

Examples

## Not run: 
cdm <- mockVocabRef("database")
codes <- getCandidateCodes(cdm = cdm,
keywords = "Musculoskeletal disorder",
domains = "Condition",
includeDescendants = FALSE)

orphan_codes <- summariseOrphanCodes(x = list("msk" = codes$concept_id),
cdm = cdm,
domains = "Condition",
standardConcept = "Standard",
searchInSynonyms = FALSE,
searchNonStandard = FALSE,
includeDescendants = TRUE,
includeAncestor = FALSE)

tableOrphanCodes(orphan_codes)

CDMConnector::cdmDisconnect(cdm)

## End(Not run)


oxford-pharmacoepi/CodelistGenerator documentation built on May 13, 2024, 2:03 a.m.