Skip to contents

Inspect all columns whose names match var_pattern and determine whether any contain the value var_val.

Usage

any_vars(df, var_pattern, var_val = 1, attrib_name, attrib_vars = var_pattern)

Arguments

df

Data frame. Household-level microdata that contains the attribute to extract.

var_pattern

Character Regular expression used to select variables to be counted.

var_val

Numeric. Value(s) to count in columns identified by var_pattern.

attrib_name

Character. Name to give the attribute in the issues data file

attrib_vars

Character. Regular expression that identifies the variable in var.

Value

Data frame of attributes with the following columns:

  • interview__id

  • interview__key

  • attrib_name

  • attrib_val

  • attrib_vars