Learn R Programming

nhanesA (version 0.6.5.3)

nhanesSearch: Perform a search over the comprehensive NHANES variable list.

Description

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.

Usage

nhanesSearch(
  search_terms = NULL,
  exclude_terms = NULL,
  data_group = NULL,
  ignore.case = FALSE,
  ystart = NULL,
  ystop = NULL,
  includerdc = FALSE,
  nchar = 100,
  namesonly = FALSE
)

Arguments

search_terms

List of terms or keywords.

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

Value

A list of tables that match the search terms.

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.

Examples

Run this code
# NOT RUN {
 
# }
# NOT RUN {
nhanesSearch("bladder", ystart=2001, ystop=2008, nchar=50)
# }
# NOT RUN {
 
# }
# NOT RUN {
nhanesSearch("urin", exclude_terms="During", ystart=2009)
# }
# NOT RUN {
 
# }
# NOT RUN {
nhanesSearch(c("urine", "urinary"), ignore.case=TRUE, ystop=2006, namesonly=TRUE)
# }

Run the code above in your browser using DataLab