| term_search | R Documentation |
A convenience wrapper around nhanesA::nhanesSearch that returns
a simplified, concise output focused on variable names, descriptions,
and survey years. Results are sorted by year (most recent first) and
then by variable name.
term_search(var)
var |
Character. Search term or phrase to find in variable names or descriptions. Case-insensitive. Special regex characters are automatically escaped for literal matching. |
A data.frame with 4 columns:
Variable.Name: NHANES variable code
Variable.Description: Description of the variable
Data.File.Name: Name of the data file containing the variable
Begin.Year: Starting year of the survey cycle (numeric)
Results are sorted by Begin.Year (descending) then Variable.Name.
Returns an empty data.frame with correct structure if no matches found.
var_search for searching by exact variable name,
get_url for getting documentation URLs,
nhanesSearch for the underlying search function
Other search and lookup functions:
get_url(),
var_search()
# Search for diabetes-related variables (showing first 5 results)
term_search("diabetes") |> head(5)
# Search for blood pressure measurements (showing first 5 results)
term_search("blood pressure") |> head(5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.