Clinical Data Visualization in R and Python

Workshop materials for creating effective visualizations of clinical data using R and Python.

Workshop Materials

Download slides and sample data for this workshop.

Slides
Sample Dataset

Python Resources

Jupyter notebooks and scripts for Python-based visualizations.

Materials

Python 3 is required to run this notebook. We recommend using venv to create a virtual environment.

This notebook uses Seaborn for visualizations. Seaborn provides a simpler interface and more visually appealing default themes. It will automatically install pandas, numpy, matplotlib, and other dependencies.

Create Virtual Environment and Install Dependencies
python3 -m venv venv
source venv/bin/activate
pip install jupyter seaborn
For Sankey Diagrams

The notebook uses Plotly for Sankey diagrams:

pip install plotly
Run the Notebook
jupyter notebook

R Resources

R Markdown notebooks for R-based visualizations.

Materials

This notebook requires R and RStudio.

Install Required Packages
install.packages(c("ggplot2", "dplyr", "tidyr", "plotly"))

Python Chart Examples

Individual chart examples with dedicated notebooks and video tutorials.

Heatmap

Co-occurrence heatmap visualization

Faceted vs Grouped

Comparison of faceted and grouped bar charts

Panel of Plots

Multiple plots in a single panel

Age vs O2 vs Outcome

Multi-variable relationship visualization

Sankey Plot

Flow diagram visualization

Top Conditions by Day

Time series composition chart

Daily and Covid Line Plot

Time series line plot visualization

Upset Plot

Set intersection visualization