Learn R Programming

ggpedigree (version 1.1.0.3)

.pick_first: Pick First Matching Rule

Description

This function evaluates a list of rules and returns the action associated with the first rule that matches. If no rules match, it returns a default value.

Usage

.pick_first(rules, default = NULL)

Value

The action associated with the first matching rule, or the default value.

Arguments

rules

A list of rules, where each rule is a list with `when` and `do` elements.

default

The default value to return if no rules match (default is NULL).