Skip to contents

Plot summariseMeasurementTiming results.

Usage

plotMeasurementValueAsConcept(
  result,
  x = "count",
  y = "codelist_name",
  facet = c("cdm_name"),
  colour = c("concept_name", "variable_level", visOmopResults::strataColumns(result)),
  style = NULL
)

Arguments

result

A summarised_result object.

x

Columns to use as horizontal axes. See options with `visOmopResults::plotColumns(result)`.

y

Columns to use as horizontal axes. See options with `visOmopResults::plotColumns(result)`.

facet

Columns to facet by. See options with `visOmopResults::plotColumns(result)`. Formula input is also allowed to specify rows and columns.

colour

Columns to color by. See options with `visOmopResults::plotColumns(result)`.

style

Pre-defined style to apply: "default" or "darwin" - the latter just for gt and flextable. If NULL the "default" style is used.

Value

A ggplot.

Examples

# \donttest{
library(MeasurementDiagnostics)

cdm <- mockMeasurementDiagnostics()

result <- summariseMeasurementUse(
  cdm = cdm,
  bySex = TRUE,
  codes = list("test_codelist" = c(3001467L, 45875977L))
)
#> → Sampling measurement table to 20000 subjects
#> → Getting measurement records based on 2 concepts.
#> → Subsetting records to the subjects and timing of interest.
#> → Getting time between records per person.
#> Summarising timings
#>  The following estimates will be calculated:
#>  days_between_measurements: min, q25, median, q75, max, density
#> ! Table is collected to memory as not all requested estimates are supported on
#>   the database side
#> → Start summary of data, at 2026-02-09 16:09:32.524148
#>  Summary finished, at 2026-02-09 16:09:32.718257
#> → Getting measurements per subject.
#>  The following estimates will be calculated:
#>  measurements_per_subject: min, q25, median, q75, max, density
#> ! Table is collected to memory as not all requested estimates are supported on
#>   the database side
#> → Start summary of data, at 2026-02-09 16:09:33.259487
#>  Summary finished, at 2026-02-09 16:09:33.350453
#>  The following estimates will be calculated:
#>  measurements_per_subject: min, q25, median, q75, max, density
#> ! Table is collected to memory as not all requested estimates are supported on
#>   the database side
#> → Start summary of data, at 2026-02-09 16:09:33.979029
#>  Summary finished, at 2026-02-09 16:09:34.08001
#> → Summarising results - value as number.
#> Summarising value as number
#>  The following estimates will be calculated:
#>  value_as_number: min, q01, q05, q25, median, q75, q95, q99, max,
#>   count_missing, percentage_missing, density
#> ! Table is collected to memory as not all requested estimates are supported on
#>   the database side
#> → Start summary of data, at 2026-02-09 16:09:35.767594
#>  Summary finished, at 2026-02-09 16:09:36.347541
#> → Summarising results - value as concept.
#> Summarising value as number
#>  The following estimates will be calculated:
#>  value_as_concept_id: count, percentage
#> → Start summary of data, at 2026-02-09 16:09:37.083423
#>  Summary finished, at 2026-02-09 16:09:37.382128
#> → Binding all diagnostic results.

plotMeasurementValueAsConcept(result)


CDMConnector::cdmDisconnect(cdm)
# }