Package: preventr 0.12.0

Martin Mayer

preventr: An Implementation of the PREVENT and Pooled Cohort Equations

Implements the American Heart Association Predicting Risk of cardiovascular disease EVENTs (PREVENT) equations from Khan SS, Matsushita K, Sang Y, and colleagues (2023) <doi:10.1161/CIRCULATIONAHA.123.067626>, with optional comparison with their de facto predecessor, the Pooled Cohort Equations from the American Heart Association and American College of Cardiology (2013) <doi:10.1161/01.cir.0000437741.48606.98> and the revision to the Pooled Cohort Equations from Yadlowsky and colleagues (2018) <doi:10.7326/M17-3011>.

Authors:Martin Mayer [aut, cre, cph]

preventr_0.12.0.tar.gz
preventr_0.12.0.zip(r-4.7)preventr_0.12.0.zip(r-4.6)preventr_0.12.0.zip(r-4.5)
preventr_0.12.0.tgz(r-4.6-any)preventr_0.12.0.tgz(r-4.5-any)
preventr_0.12.0.tar.gz(r-4.7-any)preventr_0.12.0.tar.gz(r-4.6-any)
preventr_0.12.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
preventr/json (API)

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

Bug tracker:https://github.com/martingmayer/preventr/issues

Pkgdown/docs site:https://martingmayer.com

On CRAN:

Conda:

6.12 score 40 stars 1 packages 11 scripts 872 downloads 4 exports 25 dependencies

Last updated from:ebe2ac15c3. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK283
source / vignettesOK259
linux-release-x86_64OK289
macos-release-arm64OK292
macos-oldrel-arm64OK213
windows-develOK252
windows-releaseOK267
windows-oldrelOK251
wasm-releaseOK150

Exports:appest_riskestimate_riskplot_risk

Dependencies:clicpp11dplyrfarvergenericsggplot2gluegtableisobandlabelinglifecyclemagrittrpillarpkgconfigR6RColorBrewerrlangS7scalestibbletidyselectutf8vctrsviridisLitewithr

Plotting risk estimates
Introduction | What plot_risk() expects | Example data used in this vignette | The default behavior for data-frame input | Return formats and the roles of add_to_dat and collapse | Rendering plots directly | Using a manually constructed data frame | Reordering or restricting outcomes | Annotation controls | Removing annotation | Keeping only selected annotation components | Showing the 30-year age-warning subtitle | Color schemes | Single-color plots | Category-based plots | Cleaning threshold input | Legend and threshold-line controls | Removing the legend | Removing the dashed threshold lines | Keeping lines but removing line text | Base font size | Multiple time horizons in one data frame | Multiple people in one data frame | Working with a list of data frames | Returning a list of data frames with plots attached | Collapsing a list input to one data frame | Returning only the plots from a list input | Malformed list input is not accepted | Strict logical arguments | Viewing data frames with plots as a list column | Notes on progress | Summary

Last update: 2026-06-24
Started: 2026-06-24

Using preventr with a data frame
Using use_dat and add_to_dat | Our first call using use_dat | Progress bar | Passing a data frame with a predictor variable located in a differently-named column | Optional behavior variables: Data frame vs. in the call | Number of rows returned for a given input row = number of models requested | add_to_dat | Type-stability of return | What about the PCEs? | What about the convenience functions for eGFR and BMI? | I don't want to use use_dat and add_to_dat | Then don't! | lapply() | Map() | purrr::pmap() | Wrap-up

Last update: 2026-06-24
Started: 2025-01-26