nhanesCodebook: Display codebook for selected variable.

View source: R/nhanes_codebook.R

nhanesCodebookR Documentation

Display codebook for selected variable.

Description

Returns full NHANES codebook including Variable Name, SAS Label, English Text, Target, and Value distribution.

Usage

nhanesCodebook(nh_table, colname = NULL, dxa = FALSE)

Arguments

nh_table

The name of the NHANES table that contains the desired variable.

colname

The name of the table column (variable).

dxa

If TRUE then the 2005-2006 DXA codebook will be used (default=FALSE).

Details

Each NHANES variable has a codebook that provides a basic description as well as the distribution or range of values. This function returns the full codebook information for the selected variable. If the environment variable NHANES_TABLE_BASE was set during startup, the value of this variable is used as the base URL instead of https://wwwn.cdc.gov (this allows the use of a local or alternative mirror of the CDC documentation).

Value

The codebook is returned as a list object. Returns NULL upon error.

Examples

nhanesCodebook('AUX_D', 'AUQ020D')
nhanesCodebook('BPX_J', 'BPACSZ')
bpx_code = nhanesCodebook('BPX_J')
length(bpx_code)

nhanesA documentation built on July 4, 2024, 9:08 a.m.