createSankeyDiagram: createSankeyDiagram

View source: R/createSankeyDiagram.R

createSankeyDiagramR Documentation

createSankeyDiagram

Description

Create sankey diagram.

Usage

createSankeyDiagram(
  treatmentPathways,
  groupCombinations = FALSE,
  colors = NULL,
  ...
)

Arguments

treatmentPathways

(data.frame())
The contents of the treatmentPathways.csv-file as a data.frame().

groupCombinations

(logical(1): FALSE)

TRUE

Group all combination treatments in category "Combination".

FALSE

Do not group combination treatments.

colors

(character(n)) Vector of hex color codes.

...

Paramaters for sankeyNetwork.

Value

(htmlwidget)

Examples

# Dummy data, typically read from treatmentPathways.csv
treatmentPathways <- data.frame(
  path = c("Acetaminophen", "Acetaminophen-Amoxicillin+Clavulanate",
           "Acetaminophen-Aspirin", "Amoxicillin+Clavulanate", "Aspirin"),
  freq = c(206, 6, 14, 48, 221),
  sex = rep("all", 5),
  age = rep("all", 5),
  index_year = rep("all", 5)
)

createSankeyDiagram(treatmentPathways)

TreatmentPatterns documentation built on Sept. 11, 2024, 8:59 p.m.