Skip to contents

`r lifecycle::badge("deprecated")`

Usage

plotCohortIntersect(
  data,
  xAxis = "estimate_value",
  yAxis = "variable_name",
  plotStyle = "barplot",
  facetVarX = "variable_name",
  facetVarY = c("group_level", "strata_level"),
  colorVars = "variable_level",
  vertical_x = TRUE
)

Arguments

data

output of summariseCohortIntersect

xAxis

what to plot on x axis, default as variable_name column. Has to be a column in data.

yAxis

what to plot on y axis, default as estimate_value column. Has to be a column in data. One of the xAxis or yAxis has to be estimate_value.

plotStyle

Now allows boxplot or barplot only.

facetVarX

column in data to facet by on horizontal axis

facetVarY

column in data to facet by on vertical axis

colorVars

column in data to color by.

vertical_x

whether to display x axis string vertically.

Value

A ggplot.

Examples

# \donttest{
library(PatientProfiles)
cdm <- mockPatientProfiles()
results <- summariseCohortIntersect(
  cohort = cdm$cohort1,
  cohortIntersect = list(
    "Medications in the prior year" = list(
      targetCohortTable = "cohort2", value = "flag", window = c(-365, -1)
    )
  )
)
#> Warning: `summariseCohortIntersect()` was deprecated in PatientProfiles 0.8.0.
#>  Please use `CohortCharacteristics::summariseCohortIntersect()` instead.
#>  adding cohort intersect columns for table: cohort2
#>  summarising data
#>  The following estimates will be computed:
#>  flag_variable_00021_variable_00020: count, percentage
#>  flag_variable_00022_variable_00020: count, percentage
#> → Start summary of data, at 2024-05-11 12:03:44.166322
#>  Summary finished, at 2024-05-11 12:03:44.6309
#>  summariseCharacteristics finished!
graph <- plotCohortIntersect(results)
CDMConnector::cdmDisconnect(cdm = cdm)
# }