Decorates a data frame by adding a new column indicating whether a set (represented as a boolean vector in the data frame with a specific prefix column encoding) contains an element (stored under a specific column name). For example, it can be used to check if a candidate set contains the failed component.
Arguments
- df
A data frame.
- setvar
A character string representing the column prefix for matrix encoding.
- elvar
A character string representing the column name for elements to test membership for in setvar.
- cname
An optional character string for the name of the new column denoting outcomes of membership tests. Defaults to contains(setvar,elvar).