Package: hvtiPlotR 2.8.16

hvtiPlotR: HVTI 'ggplot2' Themes and Clinical Plot Functions for the Cleveland Clinic Heart & Vascular Institute

Themes, clinical plot constructors and methods for creating publication quality 'ggplot2' graphics in R that conform to the standards of Cardiovascular Outcomes Registries and Research (CORR) within The Heart \& Vascular Institute at the Cleveland Clinic.

Authors:John Ehrlinger [aut, cre]

hvtiPlotR_2.8.16.tar.gz
hvtiPlotR_2.8.16.zip(r-4.7-any)hvtiPlotR_2.8.16.zip(r-4.6-any)hvtiPlotR_2.8.16.zip(r-4.5-any)
hvtiPlotR_2.8.16.tgz(r-4.6-any)hvtiPlotR_2.8.16.tgz(r-4.5-any)
hvtiPlotR_2.8.16.tar.gz(r-4.7-any)hvtiPlotR_2.8.16.tar.gz(r-4.6-any)
hvtiPlotR_2.8.16.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
hvtiPlotR/json (API)

# Install 'hvtiPlotR' in R:
install.packages('hvtiPlotR', repos = c('https://ehrlinger.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ehrlinger/hvtiplotr/issues

Pkgdown/docs site:https://ehrlinger.github.io

Datasets:

On CRAN:

Conda:

quarto

5.98 score 64 scripts 98 exports 60 dependencies

Last updated from:17cb76ba25. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK297
source / vignettesOK583
linux-releaseOK390
macos-releaseOK317
macos-oldrelOK310
windows-develOK357
windows-releaseOK404
windows-oldrelOK265
wasm-releaseOK204

Exports:autoploteda_classify_vareda_select_varshazard_plothv_add_plothv_alluvialhv_atriskhv_atrisk_composehv_balancehv_balance_heighthv_consorthv_consort_excludehv_consort_patientshv_consort_starthv_consort_summaryhv_correlation_matrixhv_edahv_eda_pageshv_fit_locationhv_followuphv_followup_panelshv_ggsave_dimshv_girafehv_hazardhv_legend_insidehv_longitudinalhv_mirror_histhv_nnthv_nonparametrichv_ordinalhv_palettehv_panel_boxhv_panel_sizehv_ph_locationhv_ppt_layouthv_ppt_palettehv_ppt_serieshv_rmst_contrasthv_rmst_curveshv_role_palettehv_sankeyhv_spaghettihv_stackedhv_survivalhv_survival_differencehv_theme_dark_ppthv_theme_light_ppthv_theme_manuscripthv_theme_posterhv_theme_ppthv_trendshv_upsethv_vennis_hv_datamake_footnotemakeFootnotennt_plotsample_alluvial_datasample_cluster_sankey_datasample_consort_datasample_correlation_datasample_covariate_balance_datasample_eda_datasample_goodness_followup_datasample_hazard_cohortsample_hazard_datasample_hazard_empiricalsample_life_tablesample_longitudinal_counts_datasample_mirror_histogram_datasample_nnt_datasample_nonparametric_curve_datasample_nonparametric_curve_pointssample_nonparametric_ordinal_datasample_nonparametric_ordinal_pointssample_spaghetti_datasample_stacked_histogram_datasample_survival_datasample_survival_difference_datasample_trends_datasample_upset_datasave_manuscriptsave_pptscale_color_hvscale_colour_hvscale_fill_hvsurvival_difference_plottheme_dark_ppttheme_hv_manuscripttheme_hv_postertheme_hv_ppt_darktheme_hv_ppt_lighttheme_hv_ppt_slatetheme_light_ppttheme_mantheme_manuscripttheme_postertheme_ppt

Dependencies:askpassbase64enccliconsortcpp11digestdplyrfarverfastmapfontBitstreamVerafontLiberationfontquivergdtoolsgenericsggalluvialggplot2ggsankeyggupsetggvenngluegtablehtmltoolsisobandjsonlitelabelinglatticelazyevallifecyclemagrittrMatrixofficeropensslpatchworkpillarpkgconfigpurrrR6raggRColorBrewerRcpprlangrvgS7scalesstringistringrsurvivalsyssystemfontstextshapingtibbletidyrtidyselectutf8uuidvctrsviridisLitewithrxml2zip

Decorating and Saving hvtiPlotR Plots
The Composition Pattern | Themes | Manuscript | Poster | Light PowerPoint | Dark PowerPoint | One decorator for a whole deck | Naming the series without a legend | Designing the slide around the figure | Color Scales | Manual colors | ColorBrewer palettes | Suppressing legends | Labels and Annotations | labs() | annotate() | coord_cartesian() | Saving Figures | Manuscript PDF | Poster PDF | PowerPoint slides | Single slide | Multiple slides from a list | Fixed panel placement across slides | Multi-panel PDF (EDA batch output) | Legend Positioning | Inside the panel | Outside the panel (explicit sides) | Suppress all legends | Legend text and key size | Theme Overrides | Axis text size | Removing minor grid lines | Rotating x-axis labels | Adding a plot title and subtitle | Expanding plot margins | Multi-panel Figures with patchwork | Side-by-side plots | Controlling relative widths and heights | Stacking a plot above a risk table | Shared axis labels and panel tags | Saving a patchwork composite

Last update: 2026-10-20
Started: 2026-03-19

hvtiPlotR Plot Functions
Template Reference Map | Mirrored Propensity Score Histogram | Binary-match mode (SAVR vs. TF-TAVR) | Bare plot | Adding scales, labels, and theme | Weighted IPTW mode (Limited vs. Extended) | Bare plot | Adding scales, labels, and theme | Stacked Histogram | Count histogram | Proportion (fill) histogram | Saving | Goodness-of-Follow-Up Plot | Sample data | Death follow-up plot | Adding scales, labels, and annotations | Non-fatal event panel | Several panels over one window | Role colors across panels | Covariate Balance Plot | Adding color, shape, and axis scales | Adding directional annotations and theme | Controlling covariate order | Kaplan-Meier Survival Curve | Survival curve (PLOTS=1) | Numbers at risk and report table | Stratified analysis | Survival curve with a numbers-at-risk table | Cumulative hazard (PLOTC=1) | Log-log survival plot (Weibull/PH check) | Hazard rate (PLOTH=1) | Integrated survivorship / restricted mean survival (PLOTL=1) | RMST Contrast and Curves | Differences by estimator | Weighted curves with the RMST area | Correlation Matrix | EDA Barplots and Scatterplots | Binary categorical: count barplot | Binary categorical: percentage barplot | Ordinal and multi-level categorical | Character categorical | Continuous: scatter + LOESS | Variable selection and labels (varnames template pattern) | Several variables to a page | Saving EDA plots | Alluvial (Sankey) Plot | Fill flows by pre-operative grade | Two-axis before / after comparison | Cluster Stability Sankey Plot | Default plot (K = 2 to 9) | Custom color palette | Subset of K values | CONSORT Patient Flow Diagram | Building a tracker from your own data | The diagram | Auditing the cohort | Hazard Plot | Survival curve with KM overlay | Hazard rate curve | Cumulative hazard | Stratified by group | Life-table overlay | The hv_hazard() object interface | Survival Difference (Life-Gained) Plot | Survival difference curve | Multiple comparisons | The hv_survival_difference() object interface | Number Needed to Treat (NNT) Plot | NNT curve | Absolute risk reduction | The hv_nnt() object interface | Temporal Trend Plot | Single variable: cases/year | Single variable: age | Multiple groups with scale_color_brewer | Median summary + manual colors (NYHA style) | With confidence ribbon | Binary % outcomes (tp.lp.trends.sas) | Age as x-axis (tp.lp.trends.age.sas) | Polytomous groups: repair types (tp.lp.trends.polytomous.sas) | LV mass index (tp.dp.trends.R, plot2) | Case volume / total surgeries per year (tp.dp.trends.R, plot4) | Annotated trend: hospital LOS (tp.dp.trends.R, plot5) | Spaghetti / Profile Plot | Unstratified: AV mean gradient, full range (plot_1) | Unstratified: zoomed y-axis (plot_3) | Stratified by sex: AV mean gradient (plot_2 / plot_4) | AV area y-scale (plot_5 / plot_6) | DVI y-scale (plot_7 / plot_8) | Ordinal y-axis: MV regurgitation grade (plot_9) | With LOESS smooth overlay | Nonparametric Temporal Trend Curve | Single average curve with 68 % CI ribbon | Two-group comparison (analogous to tp.np.avpkgrad_ozak_ind_mtwt.sas) | Nonparametric Ordinal Outcome Curve | Grade probability curves with data summary points | Combined mild + moderate (p34 = p3 + p4 pattern) | Longitudinal Participation Counts | Bar chart | Numeric table panel | Two-panel layout with patchwork | Saving the combined figure | UpSet Plot | Default plot | Custom intersection bar color | Color bars by era | Venn diagram (2-3 sets) | Draft Footnotes | Draft annotation pattern | Custom analyst tag | Saving without the footnote

Last update: 2026-10-14
Started: 2026-03-19

SAS Template Migration Guide
Overview | Key concepts for SAS users | Template lookup table | Nonparametric temporal trends (tp.np.*) | SAS column name mapping | Average curve: binary outcome | Continuous outcome | Multi-group comparison | Phase decomposition | Covariate on the x-axis | Ordinal outcomes | Ordinal multi-scenario comparison | Ordinal phase independence | Ordinal phases | Survival analysis (tp.ac.dead.*, tp.cp.dead.*) | SAS → R argument mapping | Goodness of follow-up (tp.dp.gfup.R) | Covariate balance (tp.lp.propen.cov_balance.R) | Alluvial flow (tp.dp.female_bicus_preAR_sankey.R) | Cluster stability Sankey (PAM analysis) | SAS/R workflow → R equivalent | UpSet plot (tp.complexUpset.R) | Spaghetti / individual trajectories (tp.dp.spaghetti.echo.R) | Unstratified: AV mean gradient full range (plot_1) | Unstratified: zoomed y-axis (plot_3) | Stratified by sex (plot_2 / plot_4) | AV area y-scale (plot_5 / plot_6) | DVI y-scale (plot_7 / plot_8) | Ordinal y-axis: MV regurgitation grade (plot_9) | Correlation matrix (descriptive/dc.tables.ods.sas) | Trends over time (tp.*.trends.*) | tp.rp.trends.sas: cases/year and age (1968–2000 by 4) | tp.lp.trends.sas: binary % outcomes (1970–2000 by 10, y 0–100 by 10) | tp.lp.trends.age.sas: age on x-axis (25–85 by 10, y 0–100 by 20) | tp.lp.trends.polytomous.sas: repair types (1990–1999 by 1, y 0–100 by 10) | tp.dp.trends.R: LV mass index (1995–2015 by 5, y 0–200 by 50) | tp.dp.trends.R: hospital LOS with annotation (1985–2015 by 5, y 0–20 by 5) | Longitudinal patient counts (tp.dp.longitudinal_patients_measures.R) | EDA postage stamps (tp.dp.EDA_barplots_scatterplots*.R) | Mirror histogram (propensity score) | Binary-match mode (tp.lp.mirror-histogram_SAVR-TF-TAVR.R) | Weighted IPTW mode (tp.lp.mirror_histo_before_after_wt.R) | Stacked histogram | Using themes | Saving figures | PowerPoint | PDF / TIFF for journals | Parametric hazard/survival (tp.hs.*) | Parametric survival with KM overlay | Stratified by covariate | Conditional survival after hospital discharge | US life-table overlay | Treatment benefit distribution | Adding new ports | Session info

Last update: 2026-10-14
Started: 2026-03-19

hvtiPlotR: Generating plot.sas Style in R
Abstract | About this document | Introduction | The plot.sas macro | SAS → R Quick Reference | Structure and output | Axis labels and scales | Tuple statements: points and error bars | Tuple statements: lines and ribbons | Symbols and colors reference | Device and theme mapping | Generating ggplot2 graphics | Importing the data | Option 1: SAS xport file (recommended when you have SAS access) | Option 2: CSV export (when SAS is not available) | Using the bundled example data | Initialize the figure | Labels | Scales | Points | Error Bars | Lines | Line types | Shapes | Colors | Global Figure Commands | PowerPoint Figures | Themes and Decoration | Saving publication graphics | Manuscript graphics | PowerPoint graphics | Graphics rules to live by | Manuscript figures | PowerPoint figures | Color | What not to include | Conclusions | References | Affiliation:

Last update: 2026-10-13
Started: 2025-10-21

Contributing to hvtiPlotR
Development environment setup | Prerequisites | Installing development dependencies | The development workflow loop | Track A: Porting a SAS template | Step 1: Understand the SAS template output | Step 2: Create the R source file | The constructor | The print and plot methods | Step 3: Add a sample-data generator | Step 4: Write roxygen documentation | Step 5: Register in _pkgdown.yml | Step 6: Add a worked example to the plot-functions vignette | Step 7: Add a row to the SAS migration guide | Step 8: Write tests | Step 9: Update NEWS.md | Step 10: Final checklist before opening a PR | Track B: Package infrastructure | Package structure overview | Adding a dependency | Code style and conventions | File and function naming | The bare-ggplot pattern | Tidy evaluation | Testing | Test file layout | Snapshot tests | Running checks | What R CMD CHECK validates | Vignette conventions | Releasing a new version | Session info

Last update: 2026-09-28
Started: 2026-03-25

Readme and manuals

Help Manual

Help pageTopics
hvtiPlotR: Publication-Quality Graphics for Clinical Manuscripts and SlideshvtiPlotR-package hvtiPlotR
Extract the underlying data frame from an hv_data objectas.data.frame.hv_data
Produce a ggplot from an hv_data object ('autoplot' generic)autoplot.hv_data
Classify a Variable as Continuous or Categoricaleda_classify_var
Select and Reorder Variables from a Data Frameeda_select_vars
Place one plot on the current slide, fitted around the standard panelhv_add_plot
Prepare alluvial / Sankey diagram data for plottinghv_alluvial
Numbers-at-risk table panelhv_atrisk
Stack a survival curve over a numbers-at-risk tablehv_atrisk_compose
Prepare covariate balance data for plottinghv_balance
Suggested figure height for a covariate balance plothv_balance_height
Build a CONSORT flow diagram from a trackerhv_consort
Add an exclusion stage to a CONSORT trackerhv_consort_exclude
Retrieve patient IDs at a CONSORT stagehv_consort_patients
Initialize a CONSORT patient-flow trackerhv_consort_start
Stage-level CONSORT summary tablehv_consort_summary
Prepare a scatter-plot matrixhv_correlation_matrix
Prepare EDA data for a single variablehv_eda
Prepare a paginated EDA sectionhv_eda_pages
Fit a plot's chrome on the slide around a fixed panelhv_fit_location
Prepare goodness-of-follow-up data for plottinghv_followup
Prepare a set of goodness-of-follow-up panelshv_followup_panels
Compute 'ggsave()' dimensions for a fixed panel content areahv_ggsave_dims
Render a plot or page as an interactive HTML widgethv_girafe
Prepare parametric hazard / survival data for plottinghv_hazard
Place a ggplot legend inside the emptiest panel cornerhv_legend_inside
Prepare longitudinal participation counts data for plottinghv_longitudinal
Prepare mirror-histogram data for plottinghv_mirror_hist
Prepare number-needed-to-treat data for plottinghv_nnt
Prepare nonparametric temporal trend curve data for plottinghv_nonparametric
Prepare nonparametric ordinal outcome curve data for plottinghv_ordinal
The house palette for categorical groupshv_palette
Standard slide panel rectangle for a slide formathv_panel_box
Figure dimensions for a faceted plothv_panel_size
Compute 'officer::ph_location()' args for a fixed-panel slide layouthv_ph_location
Slide layout name for a slide rolehv_ppt_layout
Series colors for a slide or a manuscript figurehv_ppt_palette
Slide styling for a grouped plot, in one reusable objecthv_ppt_series
Prepare RMST contrast data for plottinghv_rmst_contrast
Prepare weighted Kaplan-Meier curves for an RMST figurehv_rmst_curves
Colors for a figure's levels, by rolehv_role_palette
Prepare cluster stability Sankey data for plottinghv_sankey
Prepare spaghetti / profile data for plottinghv_spaghetti
Prepare stacked histogram data for plottinghv_stacked
Prepare survival data for plottinghv_survival
Prepare survival difference (life-gained) data for plottinghv_survival_difference
Prepare temporal trend data for plottinghv_trends
Prepare UpSet co-occurrence data for plottinghv_upset
Prepare a Venn diagram for plottinghv_venn
hvtiPlotR ggplot2 themeshvtiPlotR-themes hv_theme_dark_ppt hv_theme_light_ppt hv_theme_manuscript hv_theme_poster hv_theme_ppt theme_dark_ppt theme_hv_manuscript theme_hv_poster theme_hv_ppt_dark theme_hv_ppt_light theme_hv_ppt_slate theme_light_ppt theme_man theme_manuscript theme_poster theme_ppt
Test whether an object is an hvtiPlotR data objectis_hv_data
Add a Draft Footnote to a FiguremakeFootnote make_footnote
Nonparametric survival estimatesnonparametric
Parametric survival estimatesparametric
Plot an hv_alluvial objectplot.hv_alluvial
Plot an hv_balance objectplot.hv_balance
Render a CONSORT flow diagramplot.hv_consort
Plot an hv_correlation_matrix objectplot.hv_correlation_matrix
Plot an hv_eda objectplot.hv_eda
Plot an hv_eda_pages objectplot.hv_eda_pages
Plot an hv_followup objectplot.hv_followup
Plot an hv_followup_panels objectplot.hv_followup_panels
Plot an hv_hazard objectplot.hv_hazard
Plot an hv_longitudinal objectplot.hv_longitudinal
Plot an hv_mirror_hist objectplot.hv_mirror_hist
Plot an hv_nnt objectplot.hv_nnt
Plot an hv_nonparametric objectplot.hv_nonparametric
Plot an hv_ordinal objectplot.hv_ordinal
Plot an hv_rmst_contrast objectplot.hv_rmst_contrast
Plot an hv_rmst_curves objectplot.hv_rmst_curves
Plot an hv_sankey objectplot.hv_sankey
Plot an hv_spaghetti objectplot.hv_spaghetti
Plot an hv_stacked objectplot.hv_stacked
Plot an hv_survival objectplot.hv_survival
Plot an hv_survival_difference objectplot.hv_survival_difference
Plot an hv_trends objectplot.hv_trends
Plot an hv_upset objectplot.hv_upset
Plot an hv_venn objectplot.hv_venn
Print an hv_alluvial objectprint.hv_alluvial
Print an hv_balance objectprint.hv_balance
Print an hv_consort objectprint.hv_consort
Print an hv_consort_tracker objectprint.hv_consort_tracker
Print an hv_eda objectprint.hv_eda
Print an hv_eda_pages objectprint.hv_eda_pages
Print an hv_followup objectprint.hv_followup
Print an hv_followup_panels objectprint.hv_followup_panels
Print an hv_hazard objectprint.hv_hazard
Print an hv_longitudinal objectprint.hv_longitudinal
Print an hv_mirror_hist objectprint.hv_mirror_hist
Print an hv_nnt objectprint.hv_nnt
Print an hv_nonparametric objectprint.hv_nonparametric
Print an hv_ordinal objectprint.hv_ordinal
Print an hv_rmst_contrast objectprint.hv_rmst_contrast
Print an hv_rmst_curves objectprint.hv_rmst_curves
Print an hv_sankey objectprint.hv_sankey
Print an hv_spaghetti objectprint.hv_spaghetti
Print an hv_stacked objectprint.hv_stacked
Print an hv_survival objectprint.hv_survival
Print an hv_survival_difference objectprint.hv_survival_difference
Print an hv_trends objectprint.hv_trends
Print an hv_upset objectprint.hv_upset
Print an hv_venn objectprint.hv_venn
Sample Sankey / Alluvial Datasample_alluvial_data
Sample Cluster Stability Sankey Datasample_cluster_sankey_data
Generate a sample CONSORT tracker for demos and testingsample_consort_data
Sample data for hv_correlation_matrix()sample_correlation_data
Generate Sample Covariate Balance Datasample_covariate_balance_data
Sample EDA Datasample_eda_data
Generate Sample Goodness-of-Follow-Up Datasample_goodness_followup_data
Sample Subject-Level Cohort Behind the Hazard Examplessample_hazard_cohort
Sample Parametric Hazard Model Predictionssample_hazard_data
Sample Kaplan-Meier Empirical Points for Hazard Plot Overlaysample_hazard_empirical
Sample Population Life Table Datasample_life_table
Sample Longitudinal Counts Datasample_longitudinal_counts_data
Generate Sample Data for Mirrored Histogramsample_mirror_histogram_data
Sample Number Needed to Treat Datasample_nnt_data
Sample Nonparametric Curve Datasample_nonparametric_curve_data
Sample Nonparametric Curve Data Pointssample_nonparametric_curve_points
Sample Nonparametric Ordinal Curve Datasample_nonparametric_ordinal_data
Sample Nonparametric Ordinal Data Pointssample_nonparametric_ordinal_points
Sample Spaghetti / Profile Plot Datasample_spaghetti_data
Generate Sample Data for Stacked Histogramsample_stacked_histogram_data
Generate Sample Survival Datasample_survival_data
Sample Survival Difference (Life-Gained) Datasample_survival_difference_data
Sample Temporal Trend Datasample_trends_data
Sample Procedure Co-occurrence Datasample_upset_data
Save a ggplot at HVTI manuscript defaultssave_manuscript
Save ggplot Objects to an Editable PowerPoint Presentationsave_ppt
Color and fill scales that apply the role rule to each panelscale_color_hv scale_colour_hv scale_fill_hv
Summarize an hv_data objectsummary.hv_data