
Plot summariseMeasurementTiming results.
plotMeasurementTimings.Rd
Plot summariseMeasurementTiming results.
Usage
plotMeasurementTimings(
result,
y = "time",
plotType = "boxplot",
timeScale = "days",
facet = visOmopResults::strataColumns(result),
colour = c("cdm_name", "codelist_name")
)
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" 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)`.
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.
result |>
dplyr::filter(variable_name == "time") |>
plotMeasurementTimings()
CDMConnector::cdmDisconnect(cdm)
# }