Learn R Programming

lfl (version 2.1.0)

consequents: Extract consequent-part (right-hand side) of rules in a list

Description

Given a list of rules or an instance of the S3 farules() class, the function returns a list of their consequents (i.e. right-hand side of rules).

Usage

consequents(rules)

Arguments

rules

Either a list of character vectors or an object of class farules().

Value

A list of character vectors.

Details

This function assumes rules to be a valid farules() object or a list of character vectors where the first element of each vector is a consequent part and the rest is an antecedent part of rules. Function returns a list of consequents.

See Also

antecedents(), farules(), searchrules()

Examples

Run this code
# NOT RUN {
    rules <- list(c('a', 'b', 'c'), c('d'), c('a', 'e'))
    consequents(rules)
    unlist(consequents(rules))   # as vector
# }

Run the code above in your browser using DataLab