Learn R Programming

nhanesA (version 0.6.5.3)

nhanesTableVars: Displays a list of variables in the specified NHANES table.

Description

Enables quick display of table variables and their definitions.

Usage

nhanesTableVars(
  data_group,
  nh_table,
  details = FALSE,
  nchar = 100,
  namesonly = FALSE
)

Arguments

data_group

The type of survey (DEMOGRAPHICS, DIETARY, EXAMINATION, LABORATORY, QUESTIONNAIRE). Abbreviated terms may also be used: (DEMO, DIET, EXAM, LAB, Q).

nh_table

The name of the specific table to retrieve.

details

If TRUE then all columns in the variable description are returned (default=FALSE).

nchar

The number of characters in the Variable Description to print. Values are limited to 0<=nchar<=128. This is used to enhance readability, cause variable descriptions can be very long.

namesonly

If TRUE then only the variable names are returned (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. Each data table contains multiple, sometimes more than 100, fields. It is helpful to list the field descriptions to ascertain quickly if a data table is of interest.

Examples

Run this code
# NOT RUN {
nhanesTableVars('LAB', 'CBC_E')
# }
# NOT RUN {
nhanesTableVars('EXAM', 'OHX_E', details=TRUE, nchar=50)
# }
# NOT RUN {
nhanesTableVars('DEMO', 'DEMO_F', namesonly = TRUE)
# }

Run the code above in your browser using DataLab