vernissage

Show clinical cohort data at their best

vernissage hex logo

Documentation Get started GitHub

A vernissage is the opening of an exhibition, when the works are hung and shown at their best. This package prepares clinical cohort data and shows them: publication-ready figures with a common theme and colour-blind safe palettes, and polished gt tables.

Data are in wide format: one row per subject, one column per variable and visit (NFL_V0, NFL_V3). Columns can be given as strings, bare names or tidyselect helpers.

Installation

# install.packages("remotes")
remotes::install_github("Clement-Poupelin/vernissage")

# optional features
install.packages(c("gt", "car", "DT", "ggrepel", "nortest", "stringi"))

What it does

Family Main functions Purpose
Import read_cohort_csv(), clean_colnames(), rename_with_map(), catalog_vars() French CSV exports (;, , decimals, Latin-1), clean names, variable catalogue
Visits visit_to_long(), visit_add_deltas(), visit_map_suffix(), combine_bilateral() long format, changes between visits, left / right means
Outliers outlier_detect(), outlier_mask(), outlier_flag_mad(), outlier_flag_iqr() modified z-score and Tukey fences, documented and referenced
Transformations transform_compare(), transform_choose(), transform_apply(), transform_boxcox() log / Box-Cox decided at baseline, applied at follow-up
Description describe_cohort(), describe_normality(), na_summary(), cor_matrix_test(), pca_compute() cohort overview table, normality, missing data, correlations, PCA
Figures plot_distribution(), plot_na_map(), plot_paired_visits(), plot_trajectories(), plot_cor_heatmap(), plot_pca_*(), plot_radar(), plot_forest() one function per figure of a cohort report
Style theme_pub(), pal_levels(), fmt_p(), label_expand() publication theme, Okabe-Ito palette, p-value and label formatting
Reports gt_pub(), gt_signif(), qmd_tabset(), qmd_callout_raw() gt tables with significance highlighting, Quarto tabsets and callouts

Example

library(vernissage)

# the cohort at a glance
describe_cohort(cohort_sim, vars = c(AGE, SEX, BMI, NFL_V0, MOCA_V0, FALL_V0),
                by = GROUP, id_col = ID)
plot_na_map(cohort_sim, vars = c(NFL_V0:CRP_V3), id_col = ID)

# distributions with outliers and group tests
plot_distribution(cohort_sim, c(NFL_V0, MOCA_V0, SEX), group = GROUP, outlier_mad = TRUE)

# how each subject moves between visits
plot_paired_visits(cohort_sim, c(NFL_V0, MOCA_V0), id_col = ID, transitions = TRUE)

# group profiles
plot_radar(cohort_sim, c(AGE, BMI, NFL_V0, IL6_V0, MOCA_V0, UPDRS_V0, SEX),
           group = GROUP, normalize = "zscore", quali_levels = list(SEX = "Female"))

The rendered figures are in the articles of the documentation: Describing a cohort, Figures, Preprocessing and Tables and Quarto reports.

Tutorials

Each tutorial runs on the simulated cohort cohort_sim shipped with the package, with all outputs and figures.

Getting started

The example cohort, a first look in three lines, the families of functions and how to select columns.

Preprocessing

French CSV import, column names, visits and long format, outliers, log / Box-Cox transformations, composite scores.

Describing a cohort

The cohort overview table, missing data, normality, correlations, principal component analysis, changes between visits.

Figures

Theme and palettes, distributions with outliers and tests, paired visits, trajectories, radar and forest plots.

Tables and Quarto reports

Number and p-value formatting, gt tables with significance highlighting, Quarto tabsets and callouts.

Function reference

Every function, its arguments and runnable examples, grouped by family.

Companion package

lodestar handles limits of detection and cut-offs (median split, tertiles, reclassification between visits).