Skip to contents

Filter a vector of REBL items to identify only those that need reverse coding using a regex matching pattern.

Usage

id_reversed_rebl_items(rebl_items, pattern, ...)

Arguments

rebl_items

A character vector of REBL item names

pattern

A regex matching pattern to identify items that need reverse coding

...

Additional arguments passed to grepl()

Value

A character vector of REBL item names that need reverse coding.

Details

This is a convenience function for identifying which REBL items need reverse coding based on a pattern. For example, if items that need reverse coding have "reverse" or "neg" in their names, you can use a pattern to identify them. The function filters the provided vector of REBL items to return only those matching the pattern.

Examples

if (FALSE) { # \dontrun{
  # First get all REBL items
  rebl_items <- id_rebl_items(example, '^rebl_')
  
  # Then identify which ones need reverse coding
  reversed_items <- id_reversed_rebl_items(rebl_items, 'reverse')
  reversed_items <- id_reversed_rebl_items(rebl_items, '_neg$')
  reversed_items <- id_reversed_rebl_items(rebl_items, 'item[135]$')
} # }