R/nhanes_search.R
nhanesSearch.Rd
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.
nhanesSearch(
search_terms = NULL,
exclude_terms = NULL,
data_group = NULL,
ignore.case = FALSE,
ystart = NULL,
ystop = NULL,
includerdc = FALSE,
nchar = 128,
namesonly = FALSE
)
List of terms or keywords.
List of exclusive terms or keywords.
Which data groups (e.g. DIET, EXAM, LAB) to search. Default is to search all groups.
Ignore case if TRUE. (Default=FALSE).
Four digit year of first survey included in search, where ystart >= 1999.
Four digit year of final survey included in search, where ystop >= ystart.
If TRUE then RDC only tables are included in list (default=FALSE).
Truncates the variable description to a max length of nchar.
If TRUE then only the table names are returned (default=FALSE).
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.
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.