Find the element of nms
that looks like an time variable.
If no elements look like a time variable, or if
two or more elements do,
then return NULL
.
Arguments
- nms
A character vector
Value
An element of nms
, or NULL
.
Examples
find_var_time(c("Sex", "Year", "AgeGroup", NA)) ## one valid
#> [1] "Year"
find_var_time(c("Sex", "Region")) ## none valid
#> NULL
find_var_time(c("time", "year")) ## two valid
#> NULL