Skip to contents

Recode REBL items from Yes/No to 1/0. Does not deal with reverse coding. See reverse_code_rebl_items() for that.

Usage

recode_rebl(df, rebl_items)

Arguments

df

A dataframe that includes all the REBL items

rebl_items

A character vector of all REBL items. You can use id_rebl_items() to get this.

Value

Same dataframe with "Yes" and "No" coded to 1 and 0 as factors based on which one is the PEB

Details

Will show a warning if any of the REBL items provided do not appear in the data frame.

Examples

if (FALSE) { # \dontrun{
  rebl_items <- id_rebl_items(raw_example, '^(?!res).*')
  df <- recode_rebl(raw_example, rebl_items)
} # }