Learn R Programming

DrugUtilisation (version 1.3.1)

plotDiscontinuationAsSurvival: Plot discontinuation

Description

Plot discontinuation

Usage

plotDiscontinuationAsSurvival(
  result,
  facet = "cohort_name",
  colour = c("variable_name", strataColumns(result)),
  ribbon = TRUE,
  style = NULL
)

Value

Plot probability to continue the drug over over time

Arguments

result

A summarised_result object.

facet

Columns to facet by. See options with availablePlotColumns(result). Formula is also allowed to specify rows and columns.

colour

Columns to color by. See options with availablePlotColumns(result).

ribbon

Whether to plot a ribbon with the confidence intervals.

style

Visual theme to apply. Character, or NULL. If a character, this may be either the name of a built-in style (see plotStyle()), or a path to a .yml file that defines a custom style. If NULL, the function will use the explicit default style, unless a global style option is set (see visOmopResults::setGlobalPlotOptions()) or a _brand.yml file is present (in that order). Refer to the visOmopResults package vignette on styles to learn more.

Examples

Run this code
# \donttest{
library(DrugUtilisation)

cdm <- mockDrugUtilisation()

result <- cdm$cohort1 |>
  summariseDiscontinuationAsSurvival(followUpDays = 365)

plotDiscontinuationAsSurvival(result)
# }

Run the code above in your browser using DataLab