satisfies() is an S7 generic that checks whether each row in a
dataset is satisfied by an anchor's predicates, with methods available
for the following classes:
Examples
# Construct two predicates.
pred_x <- predicate(
feature = "x",
operator = `>`,
constant = 0.5
)
pred_y <- predicate(
feature = "y",
operator = `<`,
constant = 0.8
)
# Combine predicates into an anchor.
anchor <- anchors(
predicates = c(pred_x, pred_y)
)
data <- data.frame(
x = c(0.2, 0.6, 0.7, 0.9),
y = c(0.3, 0.5, 0.9, 0.7)
)
# Determine which observations satisfy all predicates.
satisfies(anchor, data)
#> [1] FALSE TRUE FALSE TRUE