Perform a search over the comprehensive NHANES variable list.
Perform a search over the comprehensive NHANES variable list.
The descriptions in the master variable list will be filtered by the provided search terms to retrieve a list of relevant variables. The search can be restricted to specific survey years by specifying ystart and/or ystop.
exclude_terms: List of exclusive terms or keywords.
data_group: Which data groups (e.g. DIET, EXAM, LAB) to search. Default is to search all groups.
ignore.case: Ignore case if TRUE. (Default=FALSE).
ystart: Four digit year of first survey included in search, where ystart >= 1999.
ystop: Four digit year of final survey included in search, where ystop >= ystart.
includerdc: If TRUE then RDC only tables are included in list (default=FALSE).
nchar: Truncates the variable description to a max length of nchar.
namesonly: If TRUE then only the table names are returned (default=FALSE).
Returns
Returns a data frame that describes variables that matched the search terms. If namesonly=TRUE, then a character vector of table names that contain matched variables is returned.
Details
nhanesSearch is useful to obtain a comprehensive list of relevant tables. Search terms will be matched against the variable descriptions in the NHANES Comprehensive Variable Lists. Matching variables must have at least one of the search_terms and not have any exclude_terms. The search may be restricted to specific surveys using ystart and ystop. If no arguments are given, then nhanesSearch returns the complete variable list.