Skip to contents

Format a measurement_timings object into a visual table

Usage

tableMeasurementValueAsNumeric(
  result,
  type = "gt",
  header = c(visOmopResults::strataColumns(result)),
  groupColumn = c("codelist_name"),
  settingsColumn = character(),
  hide = c("variable_name", "variable_level"),
  style = "default",
  .options = list()
)

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 `visOmopResults::tableColumns(result)`.

groupColumn

Columns to group by. See options with `visOmopResults::tableColumns(result)`.

settingsColumn

Columns from settings to include in results. See options with `visOmopResults::settingsColumns(result)`.

hide

Columns to hide from the visualisation. See options with `visOmopResults::tableColumns(result)`.

style

Named list that specifies how to style the different parts of the table generated. It can either be a pre-defined style ("default" or "darwin" - the latter just for gt and flextable), NULL to get the table type default style, or custom. Keep in mind that styling code is different for all table styles. To see the different styles use visOmopResults::tableStyle().

.options

A named list with additional formatting options. `visOmopResults::tableOptions()` shows allowed arguments and their default values.

Value

A formatted table

Examples

# \donttest{
library(MeasurementDiagnostics)
cdm <- mockMeasurementDiagnostics()
result <- summariseMeasurementUse(
              cdm = cdm,
              codes = list("test_codelist" = c(3001467L, 45875977L)))
#> → Getting measurement records based on 2 concepts.
#> → Subsetting records to the subjects and timing of interest.
#> → Getting time between records per person.
#> → Summarising results - value as number.
#> → Summarising results - value as concept.
#> → Binding all diagnostic results.
tableMeasurementValueAsNumeric(result)
CDM name Concept name Concept ID Domain ID Unit concept name Unit concept ID Estimate name Estimate value
test_codelist
mock database overall overall overall kilogram 9529 N 50
Median [Q25 - Q75] 8.77 [7.07 - 10.48]
Q05 - Q95 5.70 - 11.84
Q01 - Q99 5.43 - 12.11
Range 5.36 to 12.18
Missing value, N (%) 2 (4.00%)
- - N 50
Median [Q25 - Q75] 8.77 [7.10 - 10.44]
Q05 - Q95 5.77 - 11.77
Q01 - Q99 5.50 - 12.04
Range 5.44 to 12.11
Missing value, N (%) 3 (6.00%)
Alkaline phosphatase.bone [Enzymatic activity/volume] in Serum or Plasma 3001467 Measurement kilogram 9529 N 50
Median [Q25 - Q75] 8.77 [7.07 - 10.48]
Q05 - Q95 5.70 - 11.84
Q01 - Q99 5.43 - 12.11
Range 5.36 to 12.18
Missing value, N (%) 2 (4.00%)
- - N 50
Median [Q25 - Q75] 8.77 [7.10 - 10.44]
Q05 - Q95 5.77 - 11.77
Q01 - Q99 5.50 - 12.04
Range 5.44 to 12.11
Missing value, N (%) 3 (6.00%)
CDMConnector::cdmDisconnect(cdm = cdm) # }