Skip to contents

It provides a formatted table with the contents of the summariseSequenceRatios output.

Usage

tableSequenceRatios(
  result,
  type = "gt",
  estimateNameFormat = c(`N (%)` = "<count> (<percentage> %)", `SR (CI)` =
    "<point_estimate> (<lower_CI> - <upper_CI>)"),
  style = "default",
  studyPopulation = TRUE,
  cdmName = TRUE,
  .options = NULL
)

Arguments

result

A sequence_symmetry object.

type

Type of desired formatted table, possibilities: "gt", "flextable", "tibble".

estimateNameFormat

The columns that the user wishes to see for the formatted table, by default it would display both the counts and sequence ratios.

style

Named list that specifies how to style the different parts of a gt table or flextable. See visOmopResults package for more information on how to define a style. Alternatively, use "default" to get visOmopResults style, or NULL for gt/flextable default styling.

studyPopulation

whether to report the study population.

cdmName

whether to report database names.

.options

named list with additional formatting options. tableSequenceRatiosOptions() shows allowed arguments and their default values.

Value

A formatted version of the sequence_symmetry object.

Examples

# \donttest{
library(CohortSymmetry)
cdm <- mockCohortSymmetry()
#> Warning: ! 6 column in person do not match expected column type:
#>  `gender_concept_id` is numeric but expected integer
#>  `year_of_birth` is numeric but expected integer
#>  `month_of_birth` is numeric but expected integer
#>  `race_concept_id` is numeric but expected integer
#>  `ethnicity_concept_id` is numeric but expected integer
#>  `location_id` is numeric but expected integer
#> Warning: ! 1 column in observation_period do not match expected column type:
#>  `period_type_concept_id` is numeric but expected integer
#> Warning: ! 9 column in cdm_source do not match expected column type:
#>  `cdm_source_abbreviation` is logical but expected character
#>  `cdm_holder` is logical but expected character
#>  `source_description` is logical but expected character
#>  `source_documentation_reference` is logical but expected character
#>  `cdm_etl_reference` is logical but expected character
#>  `source_release_date` is logical but expected date
#>  `cdm_release_date` is logical but expected date
#>  `cdm_version` is numeric but expected character
#>  `vocabulary_version` is logical but expected character
#> Warning: ! 3 column in concept do not match expected column type:
#>  `concept_id` is numeric but expected integer
#>  `valid_start_date` is character but expected date
#>  `valid_end_date` is character but expected date
#> Warning: ! 1 column in vocabulary do not match expected column type:
#>  `vocabulary_concept_id` is numeric but expected integer
#> Warning: ! 5 column in concept_relationship do not match expected column type:
#>  `concept_id_1` is numeric but expected integer
#>  `concept_id_2` is numeric but expected integer
#>  `valid_start_date` is logical but expected date
#>  `valid_end_date` is logical but expected date
#>  `invalid_reason` is logical but expected character
#> Warning: ! 2 column in concept_synonym do not match expected column type:
#>  `concept_id` is numeric but expected integer
#>  `language_concept_id` is numeric but expected integer
#> Warning: ! 4 column in concept_ancestor do not match expected column type:
#>  `ancestor_concept_id` is numeric but expected integer
#>  `descendant_concept_id` is numeric but expected integer
#>  `min_levels_of_separation` is numeric but expected integer
#>  `max_levels_of_separation` is numeric but expected integer
#> Warning: ! 9 column in drug_strength do not match expected column type:
#>  `drug_concept_id` is numeric but expected integer
#>  `ingredient_concept_id` is numeric but expected integer
#>  `amount_unit_concept_id` is numeric but expected integer
#>  `numerator_unit_concept_id` is numeric but expected integer
#>  `denominator_value` is logical but expected numeric
#>  `denominator_unit_concept_id` is numeric but expected integer
#>  `box_size` is numeric but expected integer
#>  `valid_start_date` is character but expected date
#>  `valid_end_date` is character but expected date
#> Warning: There are observation period end dates after the current date: 2024-09-23
#>  The latest max observation period end date found is 2026-10-26
#> Warning: ! 6 column in person do not match expected column type:
#>  `gender_concept_id` is numeric but expected integer
#>  `year_of_birth` is numeric but expected integer
#>  `month_of_birth` is numeric but expected integer
#>  `race_concept_id` is numeric but expected integer
#>  `ethnicity_concept_id` is numeric but expected integer
#>  `location_id` is numeric but expected integer
#> Warning: ! 1 column in observation_period do not match expected column type:
#>  `period_type_concept_id` is numeric but expected integer
#> Warning: There are observation period end dates after the current date: 2024-09-23
#>  The latest max observation period end date found is 2026-10-26
cdm <- generateSequenceCohortSet(cdm = cdm,
                                 indexTable = "cohort_1",
                                 markerTable = "cohort_2",
                                 name = "joined_cohort")
res <- summariseSequenceRatios(cohort = cdm$joined_cohort)
#> Warning: For at least some combinations, index is always before marker or marker always
#> before index
#> -- 5 combinations of 8 had index always before marker
#> -- 5 combinations of 8 had marker always before index
#> Warning: `cdm_name` is present in both 'settings' and 'summarised_result'. This will be
#> an error in the next release.
#> Warning: `cdm_name` is present in both 'settings' and 'summarised_result'. This will be
#> an error in the next release.
#> Warning: `cdm_name` is present in both 'settings' and 'summarised_result'. This will be
#> an error in the next release.
gtResult <- tableSequenceRatios(res)
#> Warning: `cdm_name` is present in both 'settings' and 'summarised_result'. This will be
#> an error in the next release.
CDMConnector::cdmDisconnect(cdm = cdm)
# }