nhanesTables function

Returns a list of table names for the specified survey group.

Returns a list of table names for the specified survey group.

Enables quick display of all available tables in the survey group.

nhanesTables( data_group, year, nchar = 128, details = FALSE, namesonly = FALSE, includerdc = FALSE )

Arguments

  • data_group: The type of survey (DEMOGRAPHICS, DIETARY, EXAMINATION, LABORATORY, QUESTIONNAIRE). Abbreviated terms may also be used: (DEMO, DIET, EXAM, LAB, Q).
  • year: The year in yyyy format where 1999 <= yyyy.
  • nchar: Truncates the table description to a max length of nchar.
  • details: If TRUE then a more detailed description of the tables is returned (default=FALSE).
  • namesonly: If TRUE then only the table names are returned (default=FALSE).
  • includerdc: If TRUE then RDC only tables are included in list (default=FALSE).

Returns

Returns a data frame that contains table attributes. If namesonly=TRUE, then a character vector of table names is returned.

Details

Function nhanesTables retrieves a list of tables and a description of their contents from the NHANES website. This provides a convenient way to browse the available tables. NULL is returned when an HTML read error is encountered.

Examples

exam = nhanesTables('EXAM', 2007) dim(exam) lab = nhanesTables('LAB', 2009, details=TRUE, includerdc=TRUE) dim(lab) q = nhanesTables('Q', 2005, namesonly=TRUE) length(q) diet = nhanesTables('DIET', 'P') dim(diet) exam = nhanesTables('EXAM', 'Y') dim(exam)
  • Maintainer: Christopher Endres
  • License: GPL (>= 2)
  • Last published: 2025-01-10