filter.rules: Filtering a set of rules

filter.rulesR Documentation

Filtering a set of rules

Description

This function facilitate the selection of a subset from a set of rules.

Usage

filter.rules(
  rules,
  pattern = NULL,
  left = pattern,
  right = pattern,
  removeMatches = FALSE
)

Arguments

rules

A set of rules.

pattern

A pattern to match (antecedent and consequent): a character string.

left

A pattern to match (antecedent only): a character string.

right

A pattern to match (consequent only): a character string.

removeMatches

A logical indicating whether to remove matching rules (TRUE) or to keep those (FALSE).

Value

The filtered set of rules.

See Also

apriori, subset

Examples

require ("arules")
data ("Adult")
r = apriori (Adult, parameter = list (supp = .4, conf = .8))
inspect (filter.rules (r, right = "marital-status="))
# The equivalent call in arules itself
subset (r, subset = rhs %pin% "marital-status=")

fdm2id documentation built on Aug. 28, 2026, 9:07 a.m.