Changelog
Source:NEWS.md
essential8 0.9.0
CRAN release: 2026-11-14
Major Changes
-
score_le8()now scores children aged 4 months to 19 years with the pediatric LE8 definitions (Table 1 and Supplemental Appendix 2 of the 2022 advisory). Rows are routed byage, so adults and children can be scored in one call, and the newle8_populationcolumn records which definitions were used. Components AHA does not define at a child’s age (for example, blood pressure before age 1) areNAand are excluded frommin_components. - Pediatric MEPA uses the same input columns as adults, plus
milk_sourceat 6-23 months: 6 items at 6-23 months, 10 items at 2-5 years (10 points per item), and all 16 items with adult bands from age 6.mepa_totalreports items met on the age-appropriate screener. - New pediatric inputs:
age_months,milk_source,active_play_minutes,bmi_percentile,bmi_percent_of_p95,infant_weight_percentile,infant_weight_z_change, and the AAP 2017 blood-pressure referencessystolic_bp_p90,systolic_bp_p95,diastolic_bp_p90, anddiastolic_bp_p95. - New
add_pediatric_references()derives the growth-chart and blood-pressure reference inputs from sex, age, height, and weight using the suggested packages cdcanthro and pedbp. - New
vignette("pediatric-scoring"). -
score_le8()results now carry the classessential8_scoreson top of the input’s class (data frames, tibbles, and grouped tibbles are otherwise unchanged), with new methods:-
summary()reports the number of rows scored, the distribution of the composite and each component score, and the cardiovascular health categories. -
tidy()reshapes the scores into long format, one row per input row and measure.tidy()is re-exported from generics. -
plot()draws the mean scores, their distributions (type = "distribution"), or a histogram of the composite score by category (type = "composite") with ggplot2.type = "forest"draws the mean scores with confidence intervals, optionally compared across the groups inby, usingggforestplotR::ggforestplot(); other arguments toplot()are passed on toggforestplot(). - With dplyr,
summarise()(orsummarize()) without expressions returns thesummary()statistics as a data frame, by group with.by. Summaries with expressions are handled by dplyr as before.
-
- Multiple imputation of missing inputs with mice:
-
score_le8(impute = TRUE)imputes missing inputs, scores every imputed data set, and returns them stacked with an.impcolumn.summary(),summarise(),tidy(), andplot()on the result pool across imputations with Rubin’s rules. -
le8_imputation_control()sets the number of imputations, iterations, a seed, auxiliary predictors, and othermice::mice()arguments:score_le8(impute = le8_imputation_control(m = 50, seed = 1)). - The imputation imputes an input only for participants whose age uses it, limits each model’s predictors to inputs available for everyone it applies to, and never imputes a combination AHA does not score (for example, diagnosed diabetes without an HbA1c value, or current combustible smoking with current inhaled-NDS use).
le8_imputation_setup()shows these settings, andscore_le8_imputed()scores a mice run of your own.
-
- New
vignette("case-study")works through a complete project: scoring 500 simulated children and adults, choosingmin_components, imputing missing laboratory values, and summarizing and plotting the results. - New
as_le8_scores()restores theessential8_scoresclass to scored data aftergroup_by(),as_tibble(), or reading saved results.
Breaking Changes
- Component score columns no longer have the
le8_prefix: they are nowdiet_score,physical_activity_score,nicotine_score,sleep_score,bmi_score,blood_lipids_score,blood_glucose_score, andblood_pressure_score.le8_n_componentsis nown_components. Columns that describe the LE8 composite keep the prefix:le8_composite_score,le8_complete,le8_category, andle8_population. - Because output names are reserved,
datathat already contains one of the new names (for example, asleep_scorefrom another instrument) or one of the oldle8_-prefixed names now raises an error. Rename those columns before scoring.
Minor Changes
- Errors now report
score_le8()as the call rather than an internal helper.
essential8 0.3.0
Major Changes
- Added DASH and HEI-2015 support to
score_le8(). Both methods accept raw food and nutrient inputs, existing diet scores, or percentiles (#9). - Added packaged NHANES 2015-2018 references to convert diet scores to LE8 points, with options to supply a custom reference or scoring cutpoints.
- Raw scoring returns
dash_totalorhei2015_total. HEI-2015 also returns all 13 component scores.
Bug Fixes
- Diagnosed diabetes with a missing
glucose_measureis no longer scored as thoughglucose_valuewere HbA1c; the glucose score is now missing. -
apply_lean_muscular_bmi_override = TRUEno longer awards 100 BMI points whenbmiorbmi_profileis missing. - Missing values in
apply_lean_muscular_bmi_overrideandapply_prediabetes_metformin_penaltynow blank a score only for records where the adjustment could apply. - Entirely missing input columns stored as logical
NA(such as blank CSV columns) are treated as missing instead of raising a type error. -
le8_physical_activity_scoreis now always double, including when activity inputs are entirely missing. -
score_le8()now returns an object of the same class asdata, so tibbles and grouped tibbles are preserved.
Breaking Changes
- Input column names that differ from a case-sensitive LE8 input name only by case (for example
BMI) now raise an error instead of being ignored. - Supplying some but not all 16 MEPA items, or omitting any raw DASH or HEI-2015 column once raw scoring is selected, now raises an error naming the missing columns instead of silently returning missing diet scores.
-
mepa_columnsnow requiresdiet_method = "mepa", anddashorhei2015index columns are rejected underdiet_method = "percentile".
Minor Changes
- Raw DASH scoring now returns the eight
dash_<field>_scorecomponent scores, matching the raw HEI-2015 output. - An entirely missing
diet_valuecolumn no longer blocks scoring of adashorhei2015index column. - A logical
femalecolumn is accepted as the MEPA sex field. - Removed unused internal rule-schema scaffolding.
- Expanded the diet vignette to explain MEPA, DASH, and HEI-2015, their role in LE8, and how their scores are calculated.
- Simplified the README and examples, using consistent tidy workflows.
essential8 0.2.0
CRAN release: 2026-10-10
Major Changes
-
score_le8()can now work with data that have missing values (#7). - Added
min_components, an argument to control how many available components are required forle8_composite_score. Valid options range from 1-8.
Minor Changes
- Added
le8_n_componentsandle8_completeoutputs for transparent reporting of the available components for LE8 composite scores. - Added consolidated, classed warnings when one or more LE8 components cannot be calculated for any observation, including a stronger warning when structural missingness makes
min_componentsimpossible to reach.
essential8 0.1.0
CRAN release: 2026-09-03
Major Changes
- Added
score_le8()for complete adult records aged 20 years or older, using the eight component definitions in the AHA 2022 Presidential Advisory. - Added raw 16-item MEPA derivation with exact case-insensitive screener-column matching, optional explicit column mappings, an auditable
mepa_total, and population-percentile diet scoring. - Added moderate-equivalent activity minutes, general or Asian-Pacific BMI profiles, and explicit glucose-measure selection.
- Changed
score_le8()to take one scalardiet_methodargument per call, defaulting to"mepa"; percentile calls requirediet_value, and data using both methods must be scored in separate calls. - Renamed the composite output from
le8_scoretole8_composite_score. - Expanded MEPA sex input to accept trimmed, case-insensitive
m/fandmale/female, plus numeric or character0/1(0is male and1is female). The default field issex,femaleis recognized whensexis absent, and other field names can be supplied throughmepa_columns. - Added a reproducible Get Started vignette.