Skip to contents

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

Usage

find_var_sexgender(nms)

Arguments

nms

A character vector

Value

An element of nms, or NULL.

Examples

find_var_sexgender(c("Sex", "Year", "AgeGroup", NA)) ## one valid
#> [1] "Sex"
find_var_sexgender(c("Age", "Region"))               ## none valid
#> NULL
find_var_sexgender(c("sexgender", "sexes"))          ## two valid
#> NULL