Learn R Programming

MeasurementDiagnostics (version 0.2.0)

plotMeasurementSummary: Plot summariseMeasurementTiming results.

Description

Plot summariseMeasurementTiming results.

Usage

plotMeasurementSummary(
  result,
  y = "time",
  plotType = "boxplot",
  timeScale = "days",
  facet = visOmopResults::strataColumns(result),
  colour = c("cdm_name", "codelist_name"),
  style = NULL
)

Value

A ggplot.

Arguments

result

A summarised_result object.

y

Variable to plot on y axis, it can be "time" or "measurements_per_subject".

plotType

Type of plot, either "boxplot", "barplot", or "densityplot".

timeScale

Time scale to show, it can be "days" or "years".

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.

Examples

Run this code
# \donttest{
library(MeasurementDiagnostics)
library(dplyr)

cdm <- mockMeasurementDiagnostics()

result <- summariseMeasurementUse(
  cdm = cdm,
  codes = list("test_codelist" = c(3001467L, 45875977L))
)

result |>
  filter(variable_name == "time") |>
  plotMeasurementSummary()

CDMConnector::cdmDisconnect(cdm)
# }

Run the code above in your browser using DataLab