Skip to contents

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.

Usage

md_set_contains(df, setvar, elvar, cname = NULL)

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).

Value

A decorated data frame with a new column cname indicating the membership test outcomes.