plotLargeScaleCharacteristics: create a ggplot from the output of...

View source: R/plotLargeScaleCharacteristics.R

plotLargeScaleCharacteristicsR Documentation

create a ggplot from the output of summariseLargeScaleCharacteristics.

Description

[Experimental]

Usage

plotLargeScaleCharacteristics(
  result,
  facet = c("cdm_name", "cohort_name"),
  colour = "variable_level"
)

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).

Value

A ggplot2 object.

Examples

## Not run: 
library(CohortCharacteristics)
library(duckdb)
library(CDMConnector)
library(DrugUtilisation)

con <- dbConnect(duckdb(), eunomiaDir())
cdm <- cdmFromCon(con, cdmSchem = "main", writeSchema = "main")

cdm <- generateIngredientCohortSet(
  cdm = cdm, name = "my_cohort", ingredient = "acetaminophen"
)

resultsLsc <- cdm$my_cohort |>
  summariseLargeScaleCharacteristics(
    window = list(c(-365, -1), c(1, 365)),
    eventInWindow = "condition_occurrence"
  )

resultsLsc |>
  plotLargeScaleCharacteristics(
    facet = c("cdm_name", "cohort_name"),
    colour = "variable_level"
  )

cdmDisconnect(cdm)

## End(Not run)


CohortCharacteristics documentation built on April 3, 2025, 10:29 p.m.