Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


OmopSketch (version 0.3.2)

plotObservationPeriod: Create a plot from the output of summariseObservationPeriod().

Description

Create a plot from the output of summariseObservationPeriod().

Usage

plotObservationPeriod(
  result,
  variableName = "Number subjects",
  plotType = "barplot",
  facet = NULL,
  colour = NULL
)

Value

A ggplot2 object.

Arguments

result

A summarised_result object.

variableName

The variable to plot it can be: "number subjects", "records per person", "duration" or "days to next observation period".

plotType

The plot type, it can be: "barplot", "boxplot" or "densityplot".

facet

Columns to colour by. See possible columns to colour by with: visOmopResults::tidyColumns().

colour

Columns to colour by. See possible columns to colour by with: visOmopResults::tidyColumns().

Examples

Run this code
# \donttest{
cdm <- mockOmopSketch(numberIndividuals = 100)

result <- summariseObservationPeriod(cdm$observation_period)

result |>
  plotObservationPeriod(
    variableName = "Duration in days",
    plotType = "boxplot"
  )

PatientProfiles::mockDisconnect(cdm)
# }

Run the code above in your browser using DataLab