nh_table: The name of the NHANES table to retrieve.
colnames: The names of the columns to translate. It will translate all the columns by default.
data: If a data frame is passed, then code translation will be applied directly to the data frame.
In that case the return argument is the code-translated data frame.
nchar: Applies only when data is defined. Code translations can be very long.
Truncate the length by setting nchar (default = 128).
mincategories: The minimum number of categories needed for code translations to be applied to the data (default=1).
details: If TRUE then all available table translation information is displayed (default=FALSE).
dxa: If TRUE then the 2005-2006 DXA translation table will be used (default=FALSE).
cleanse_numeric: Logical flag. If TRUE, some special codes in numeric variables, such as Refused and Don't know will be converted to NA.
Returns
The code translation table (or translated data frame when data is defined). Returns NULL upon error.
Details
Most NHANES data tables have encoded values. E.g. 1 = 'Male', 2 = 'Female'. Thus it is often helpful to view the code translations and perhaps insert the translated values in a data frame. Only a single table may be specified, but multiple variables within that table can be selected. Code translations are retrieved for each 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).