Learn R Programming

poputils (version 0.4.1)

find_var_age: Identify an Age Variable

Description

Find the element of nms that looks like an age variable. If no elements look like an age variable, or if two or more elements do, then return NULL.

Usage

find_var_age(nms)

Value

An element of nms, or NULL.

Arguments

nms

A character vector

See Also

find_var_time(), find_var_sexgender()

Examples

Run this code
find_var_age(c("Sex", "Year", "AgeGroup", NA)) ## one valid
find_var_age(c("Sex", "Year"))                 ## none valid
find_var_age(c("age", "age.years"))            ## two valid

Run the code above in your browser using DataLab