Learn R Programming

heiscore (version 0.0.1)

selectDataset: Retrieve a tibble with WWEIA NHANES data

Description

This function retrieves a tibble containing the raw 24-hour recall data from the What We Eat in America (WWEIA), National Health and Nutrition Examination Survey (NHANES) converted to the U.S. Department of Agriculture (USDA) Food Patterns components from the NHANES cycle selected.

Usage

selectDataset(year)

Value

A tibble containing Food Patterns component consumption, sample weights, and demographic information for each subject in the selected NHANES cycle.

Arguments

year

The NHANES cycle to select, choose from: "0506", "0708", "0910", "1112", "1314", "1516", or "1718".

Examples

Run this code
# Retrieve WWEIA NHANES data for the 2015-2016 cycle
FPED_1516 <- selectDataset(year = "1516")
FPED_1516

# Retrieve WWEIA NHANES data for the year 2017-2018 cycle
FPED_1718 <- selectDataset(year = "1718")
FPED_1718

Run the code above in your browser using DataLab