Learn R Programming

CohortSymmetry (version 0.2.4)

plotSequenceRatios: A plot for the sequence ratios.

Description

It provides a ggplot of the sequence ratios of index and marker cohorts.

Usage

plotSequenceRatios(
  result,
  onlyASR = FALSE,
  plotTitle = NULL,
  labs = c("SR", "Drug Pairs"),
  colours = c("red", "blue"),
  facet = NULL
)

Value

A plot for the sequence ratios of index and marker cohorts.

Arguments

result

Table output from summariseSequenceRatios.

onlyASR

If set to be TRUE then only adjusted SR will be plotted. Otherwise if it is set to be FALSE then both adjusted and crude SR will be plotted.

plotTitle

Title of the plot, if NULL no title will be included in the plot.

labs

Axis labels for the plot.

colours

Colours for sequence ratio.

facet

The variable to facet by.

Examples

Run this code
# \donttest{
library(CohortSymmetry)
cdm <- mockCohortSymmetry()
cdm <- generateSequenceCohortSet(cdm = cdm,
                                 indexTable = "cohort_1",
                                 markerTable = "cohort_2",
                                 name = "joined_cohort")
sequence_ratio <- summariseSequenceRatios(cohort = cdm$joined_cohort)
plotSequenceRatios(result = sequence_ratio)
CDMConnector::cdmDisconnect(cdm = cdm)
# }

Run the code above in your browser using DataLab