Learn R Programming

nhanesA (version 0.6.5.3)

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

Description

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

Usage

nhanesTables(
  data_group,
  year,
  nchar = 100,
  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 <= 2014.

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).

Value

The names of the tables in the specified survey group.

Details

Data are retrieved via web scraping using html wrappers from package rvest. It is often useful to display the table names in an NHANES survey. In effect this is a convenient way to browse the available NHANES tables.

Examples

Run this code
# NOT RUN {
nhanesTables('EXAM', 2007)
# }
# NOT RUN {
nhanesTables('LAB', 2009, details=TRUE, includerdc=TRUE)
# }
# NOT RUN {
nhanesTables('Q', 2005, namesonly=TRUE)
# }

Run the code above in your browser using DataLab