nhanesdata 0.2.2
CRAN release: 2026-05-04
Bug Fixes
- Fixed
create_design()crash for any analysis including 1999 or 2001 NHANES cycles. Theneeds_2yrflag was referenced but never defined, causingobject 'needs_2yr' not foundat runtime. - Fixed
create_design()requiring 2-year weight columns (wtint2yr,wtmec2yr) for datasets containing only 1999/2001 cycles, where those columns do not exist in NHANES demographic files. - Fixed fasting weight validation to check for
wtsaf4yrwhen 1999/2001 cycles are present, matching the calculation logic that already used it. - Added
wtsaf4yrtoglobalVariables()to resolve R CMD check NOTEs. - Corrected roxygen documentation that incorrectly stated 4-year fasting weights were not supported.
nhanesdata 0.2.1
CRAN release: 2026-02-28
Bug Fixes
- Converted vignettes from Quarto (.qmd) to R Markdown (.Rmd) to fix vignette build failures on Windows CI.
New Features
- Adding
create_design()function to return survey-weighted design data for use in downstream analyses. Combines cycles and properly accounts for weight type (interview, MEC, fasting) and adheres to CDC guidelines for use with earlier cycles. See CDC Weighting Guidelines for more information.
nhanesdata 0.2.0
Released: Feb. 2026
Breaking Changes
- Categorical columns across all datasets are now stored as character with human-readable labels instead of raw numeric codes. For example, BMX
bmdbmicvalues like2, 3, 4, 1are now"Normal weight","Overweight","Obese","Underweight". This affects 95 variables across 22 datasets.
Bug Fixes
- Fixed data corruption where factor-to-numeric conversion returned internal level indices instead of actual CDC codes (e.g., codes
1, 3, 4were silently stored as1, 2, 3). - Fixed continuous variables like
ridageyrandindfmpirbeing corrupted when categorical label mappings were incorrectly applied to them. - Fixed column type clashes when binding survey cycles where a column existed in some cycles but not others.
New Features
- Cross-cycle label translation: when the CDC codebook is unavailable for a particular cycle, labels are now carried over from a sibling cycle so all waves have consistent human-readable values.
- Added 5 new datasets:
dxxag,l10,l10am,lab10,lab10am(71 datasets total). - Added
inst/CITATIONforcitation("nhanesdata")support.
nhanesdata 0.1.0
Breaking Changes
-
read_r2()renamed toread_nhanes(). -
pull_nhanes()no longer exported; useread_nhanes()to load data.
Improvements
- Reduced required dependencies (moved 7 packages to Suggests).
- Dataset names are now case-insensitive.
- Improved error messages and
get_url()reliability.
Bug Fixes
- Fixed
pull_nhanes()wheresave()failed with “object not found” error. - Fixed NULL handling in
term_search()andvar_search(). - Fixed
Begin.Yearcolumn not converting to numeric.
