flag_names: Get names of imputation flag variables

View source: R/flag_names.R

flag_namesR Documentation

Get names of imputation flag variables

Description

Get names of imputation flag variables

Usage

flag_names(vars, flag = "pimp.", waves = 1:12, year = NA)

Arguments

vars

Character vector of variable names

flag

The text to use when creating the names of flag variables. If not baseline, then "qx" will be prepended to flag, where "x" is the appropriate wave.

waves

A numeric vector indicating any survey waves beyond baseline for which variable names should be looked for in vars and corresponding flag names returned

Value

Character vector of names for the imputation flag variables corresponding to vars

Examples

vars <- c("bob", "q4bob", "q8bob", "jim", "q4jim")
flag_names(vars)
flag_names(vars, waves = 4) # q8 vars treated like baseline because 8 not in waves


jgabry/RHhelpers documentation built on Feb. 22, 2024, 12:56 p.m.