preventr 0.12.1
-
User-visible changes:
-
This is a patch to implement the correction issued by the authors of the PREVENT equations on 2026-10-14 for models that use the HbA1c coefficients (i.e., the 10- and 30-year HbA1c models and the 10- and 30-year full models).
-
This correction was formally published as an erratum (https://doi.org/10.1161/CIR.0000000000001491), and it was also accompanied by a notification on their website page for their calculator (https://professional.heart.org/en/guidelines-and-statements/prevent-calculator) with an accompanying PDF of FAQs (https://professional.heart.org/-/media/PHD-Files/Guidelines-and-Statements/PREVENT/PREVENT-Update-FAQ-101426.pdf).
- I have also created archived versions of the website notification (https://web.archive.org/web/20261015220358/https://professional.heart.org/en/guidelines-and-statements/prevent-calculator) and PDF of FAQs (https://web.archive.org/web/20261016222755/https://professional.heart.org/-/media/PHD-Files/Guidelines-and-Statements/PREVENT/PREVENT-Update-FAQ-101426.pdf)
-
Minor updates to documentation stemming from new notes returned during checks of the package before submission. This was due to citations occassionally pointing to PubMed instead of using DOIs, with the new notes indicating these should be converted to DOIs. As a result of these changes, the
estimate_risk()/est_risk()function documentation now has a dedicated “References” section that points to key references.
-
-
Internal changes:
- Updates to test cases in accordance with the above
preventr 0.12.0
CRAN release: 2026-06-24
-
User-visible changes:
-
This version introduces:
plot_risk(), a function that plots risk estimates generated byestimate_risk()/est_risk()A new vignette “plot-risk” to accompany the new function
The ability to pass a data frame as the first argument of
estimate_risk()/est_risk()(e.g., instead ofest_risk(use_dat = df), users can now doest_risk(df), which will automatically translate toest_risk(use_dat = df)in the background; see the updated function documentation for more information)Minor tweaks and additions to existing documentation
-
-
Internal changes:
Rename “prevent_equations.R” to “estimate_risk.R”
Add test suite for
plot_risk()Correct a typo in a label in the
sysdata.rdafile for one of the coefficients; this is strictly a typographical change in the string/character value for one of the row headers, and it has no impact on the calculations or functionality of the package. This stemmed from errant labeling in the original publication of the PREVENT equations (i.e., the publication itself contained the same typo). Thanks to @kcjw87 for reporting this. Details, for those interested, are available at: https://github.com/martingmayer/preventr/issues/2 (#2).
preventr 0.11.0
CRAN release: 2025-01-26
-
User-visible changes:
All changes specified for
estimate_risk()also apply to its synonym,est_risk(). There are no breaking changes, only enhancements.Users can now compare results with either the original Pooled Cohort Equations (PCEs) released by the ACC/AHA in 2013 or the revised PCEs released by Yadlowsky and colleagues in 2018. This is implemented via expanding the set of valid input options for the existing argument
modelwithin theestimate_risk()function. The Shiny app has also been updated to permit estimation via the PCEs.Function arguments for
estimate_risk()are now semantically categorized as one of the following: required predictor variable, optional predictor variable, optional behavior variable. This is to help with clarity of documentation and additional features in the package. Nothing has actually changed about which arguments are required or the behavior of those arguments.The function
estimate_risk()gains the optional behavior argumentcollapse, which allows users to collapse the list of tibbles into a single tibble when relevant. To maintain backwards compatibility, this is an opt-in feature, so the default ofcollapseisFALSE.The function
estimate_risk()gains the optional behavior argumentsuse_datandadd_to_dat, which allow users to pass a data frame (as a data.frame, tibble, or data.table) to the function to carry out risk estimation against a large set of data in one function call, with the option (viaadd_to_dat = TRUE) to append the results to the data frame passed to the function. This is accompanied byvignette("using-data-frame"), which gives many examples, and also shows how to use a data frame for input even if you do not want to useuse_datandadd_to_dat.The function
estimate_risk()gains the optional behavior argumentprogress, which gives users the option to display a progress bar in the console whenuse_datis a data frame. This argument is independent ofquiet.All the above changes also have corresponding documentation within the relevant function and corresponding sections of the documentation.
-
Internal changes:
Minor edits to
is_valid_*functions (addingextra_textarg)Addition of new
is_valid_*functions in support of estimating with other modelsExpansion of verification for
is_okay_type()stemming from expansion of functionality withuse_datandadd_to_datMinor refactoring of some of the messaging functions within
estimate_risk(), including creation of new messaging for other models and scenarios specific to theuse_datandadd_to_datargumentsConsiderable addition of other helper functions and capabilities in support of estimating with other models and the
use_datandadd_to_datargumentsMoving
internal_call_* <- TRUEto inside relevant sections and changing name to*_requestedRefactoring of method to return tibble of NAs when there are input problems
Many more tests for added functionality
preventr 0.10.0
CRAN release: 2024-08-17
-
User-visible changes:
Shiny app available online at https://martingmayer.shinyapps.io/prevent-equations/ or https://tiny.cc/prevent-equations, and users can also access this via
app()-
Arguments
egfrandbmiwithin theestimate_risk()function (and its synonymest_risk()) gain the ability to accept a call to a corresponding, non-exported function rather than passing the corresponding value directly; entering the value directly remains an option (and there is no intent for that to change)For
egfr, the supported call iscalc_egfr()(or a synonym)For
bmi, the supported call iscalc_bmi()(or its synonym)
-
estimate_risk()andest_risk()now advise 30-year risk prediction for people > 59 years is questionable via two warnings:In the console (that can be suppressed by setting
quiet = TRUE)In the column
input_problemsof the return tibble (quiethas no impact here)
All the above changes also have corresponding documentation within the relevant function
-
Internal changes:
Moved
message_maybe(),warn_maybe(), andvalidto helpersAdded tests for new functionality
